diff --git a/apps/api/v1/lib/validations/webhook.ts b/apps/api/v1/lib/validations/webhook.ts index a142956d27..bd5eefe63e 100644 --- a/apps/api/v1/lib/validations/webhook.ts +++ b/apps/api/v1/lib/validations/webhook.ts @@ -1,6 +1,7 @@ import { z } from "zod"; import { WEBHOOK_TRIGGER_EVENTS } from "@calcom/features/webhooks/lib/constants"; +import { WebhookVersion } from "@calcom/features/webhooks/lib/interface/IWebhookRepository"; import { WebhookSchema } from "@calcom/prisma/zod/modelSchema/WebhookSchema"; const schemaWebhookBaseBodyParams = WebhookSchema.pick({ @@ -21,6 +22,7 @@ export const schemaWebhookCreateParams = z eventTypeId: z.number().optional(), userId: z.number().optional(), secret: z.string().optional().nullable(), + version: z.nativeEnum(WebhookVersion).optional(), // API shouldn't mess with Apps webhooks yet (ie. Zapier) // appId: z.string().optional().nullable(), }) @@ -33,6 +35,7 @@ export const schemaWebhookEditBodyParams = schemaWebhookBaseBodyParams z.object({ eventTriggers: z.enum(WEBHOOK_TRIGGER_EVENTS).array().optional(), secret: z.string().optional().nullable(), + version: z.nativeEnum(WebhookVersion).optional(), }) ) .partial() @@ -44,6 +47,7 @@ export const schemaWebhookReadPublic = WebhookSchema.pick({ eventTypeId: true, payloadTemplate: true, eventTriggers: true, + version: true, // FIXME: We have some invalid urls saved in the DB // subscriberUrl: true, /** @todo: find out how to properly add back and validate those. */ diff --git a/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts b/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts index 3f186d177b..35570173cf 100644 --- a/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts +++ b/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts @@ -1,7 +1,7 @@ import { ApiProperty, ApiPropertyOptional, PartialType } from "@nestjs/swagger"; import { IsArray, IsBoolean, IsEnum, IsOptional, IsString } from "class-validator"; -import { WebhookTriggerEvents } from "@calcom/platform-libraries"; +import { WebhookTriggerEvents, WebhookVersion } from "@calcom/platform-libraries"; export class CreateWebhookInputDto { @IsString() @@ -48,6 +48,15 @@ export class CreateWebhookInputDto { @IsOptional() @ApiPropertyOptional() secret?: string; + + @IsOptional() + @IsEnum(WebhookVersion) + @ApiPropertyOptional({ + description: "The version of the webhook", + example: WebhookVersion.V_2021_10_20, + enum: WebhookVersion, + }) + version?: WebhookVersion; } export class UpdateWebhookInputDto extends PartialType(CreateWebhookInputDto) {} diff --git a/apps/web/app/(use-page-wrapper)/settings/(settings-layout)/developer/webhooks/[id]/page.tsx b/apps/web/app/(use-page-wrapper)/settings/(settings-layout)/developer/webhooks/[id]/page.tsx index b76496fed9..6953ea0ab5 100644 --- a/apps/web/app/(use-page-wrapper)/settings/(settings-layout)/developer/webhooks/[id]/page.tsx +++ b/apps/web/app/(use-page-wrapper)/settings/(settings-layout)/developer/webhooks/[id]/page.tsx @@ -1,7 +1,6 @@ import type { PageProps } from "app/_types"; -import { _generateMetadata, getTranslate } from "app/_utils"; +import { _generateMetadata } from "app/_utils"; -import SettingsHeaderWithBackButton from "@calcom/features/settings/appDir/SettingsHeaderWithBackButton"; import { WebhookRepository } from "@calcom/features/webhooks/lib/repository/WebhookRepository"; import { EditWebhookView } from "@calcom/features/webhooks/pages/webhook-edit-view"; import { APP_NAME } from "@calcom/lib/constants"; @@ -16,21 +15,13 @@ export const generateMetadata = async ({ params }: { params: Promise<{ id: strin ); const Page = async ({ params: _params }: PageProps) => { - const t = await getTranslate(); const params = await _params; const id = typeof params?.id === "string" ? params.id : undefined; const webhookRepository = WebhookRepository.getInstance(); const webhook = await webhookRepository.findByWebhookId(id); - return ( - - - - ); + return ; }; export default Page; diff --git a/apps/web/lib/hooks/settings/platform/oauth-clients/useOAuthClientWebhooks.ts b/apps/web/lib/hooks/settings/platform/oauth-clients/useOAuthClientWebhooks.ts index 5c00198263..d8c5c6c2bb 100644 --- a/apps/web/lib/hooks/settings/platform/oauth-clients/useOAuthClientWebhooks.ts +++ b/apps/web/lib/hooks/settings/platform/oauth-clients/useOAuthClientWebhooks.ts @@ -2,6 +2,7 @@ import { useMutation, useQuery } from "@tanstack/react-query"; import type { ApiSuccessResponse } from "@calcom/platform-types"; import type { WebhookTriggerEvents } from "@calcom/prisma/enums"; +import type { WebhookVersion } from "@calcom/features/webhooks/lib/interface/IWebhookRepository"; type Input = { active: boolean; @@ -19,6 +20,7 @@ type Output = { triggers: WebhookTriggerEvents[]; secret?: string; payloadTemplate: string | undefined | null; + version?: WebhookVersion; }; export const useOAuthClientWebhooks = (clientId: string) => { diff --git a/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx b/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx index 166731c623..0856b2f89d 100644 --- a/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx +++ b/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx @@ -6,6 +6,7 @@ import { useRouter } from "next/navigation"; import Shell from "@calcom/features/shell/Shell"; import { WebhookForm } from "@calcom/features/webhooks/components"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { DEFAULT_WEBHOOK_VERSION } from "@calcom/features/webhooks/lib/interface/IWebhookRepository"; import { WebhookTriggerEvents } from "@calcom/prisma/enums"; import { showToast } from "@calcom/ui/components/toast"; @@ -82,6 +83,7 @@ export default function EditOAuthClientWebhooks() { subscriberUrl: data.subscriberUrl, triggers: data.eventTriggers, secret: data.secret ?? undefined, + version: data.version, }; if (webhook) { await updateWebhook({ @@ -95,7 +97,7 @@ export default function EditOAuthClientWebhooks() { } await refetchWebhooks(); router.push("/settings/platform/"); - } catch (err) { + } catch { showToast(t(webhookId ? "webhook_update_failed" : "webhook_create_failed"), "error"); } }} @@ -105,7 +107,12 @@ export default function EditOAuthClientWebhooks() { noRoutingFormTriggers={true} webhook={ webhook - ? { ...webhook, eventTriggers: webhook.triggers, secret: webhook.secret ?? null } + ? { + ...webhook, + eventTriggers: webhook.triggers, + secret: webhook.secret ?? null, + version: webhook.version ?? DEFAULT_WEBHOOK_VERSION, + } : undefined } /> diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index ec8b3a7660..94a7a9c507 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -3835,6 +3835,7 @@ "webhook_attendee_email": "Email of the first attendee", "webhook_attendee_timezone": "Timezone of the first attendee", "webhook_attendee_locale": "Locale of the first attendee", + "webhook_version": "Webhook Version", "webhook_team_name": "Name of the team booked", "webhook_team_members": "Members of the team booked", "webhook_video_call_url": "Video call URL for the meeting", diff --git a/packages/app-store/routing-forms/lib/formSubmissionUtils.test.ts b/packages/app-store/routing-forms/lib/formSubmissionUtils.test.ts index a8adb058fc..fa07e65dd9 100644 --- a/packages/app-store/routing-forms/lib/formSubmissionUtils.test.ts +++ b/packages/app-store/routing-forms/lib/formSubmissionUtils.test.ts @@ -5,7 +5,7 @@ import { describe, it, vi, expect, beforeEach, afterEach } from "vitest"; import { WorkflowService } from "@calcom/features/ee/workflows/lib/service/WorkflowService"; import type { Workflow } from "@calcom/features/ee/workflows/lib/types"; -import type { GetWebhooksReturnType } from "@calcom/features/webhooks/lib/getWebhooks"; +import type { WebhookSubscriber } from "@calcom/features/webhooks/lib/dto/types"; import getWebhooks from "@calcom/features/webhooks/lib/getWebhooks"; import { sendGenericWebhookPayload } from "@calcom/features/webhooks/lib/sendPayload"; import { @@ -15,6 +15,7 @@ import { WorkflowTemplates, TimeUnit, } from "@calcom/prisma/enums"; +import { WebhookVersion as WebhookVersionEnum } from "@calcom/features/webhooks/lib/interface/IWebhookRepository"; import type { FormResponse, Field } from "../types/types"; import { _onFormSubmission } from "./formSubmissionUtils"; @@ -100,7 +101,7 @@ describe("_onFormSubmission", () => { describe("Webhooks", () => { it("should call FORM_SUBMITTED webhooks", async () => { - const mockWebhook: GetWebhooksReturnType[number] = { + const mockWebhook: WebhookSubscriber = { id: "wh-1", secret: "secret", subscriberUrl: "https://example.com/webhook", @@ -109,6 +110,7 @@ describe("_onFormSubmission", () => { eventTriggers: [WebhookTriggerEvents.FORM_SUBMITTED], time: null, timeUnit: null, + version: WebhookVersionEnum.V_2021_10_20, }; vi.mocked(getWebhooks).mockResolvedValueOnce([mockWebhook]); @@ -141,7 +143,7 @@ describe("_onFormSubmission", () => { "field-1": { label: "Attendee Name", value: "John Doe" }, }; - const mockWebhook: GetWebhooksReturnType[number] = { + const mockWebhook: WebhookSubscriber = { id: "wh-1", secret: "secret", subscriberUrl: "https://example.com/webhook", @@ -150,6 +152,7 @@ describe("_onFormSubmission", () => { eventTriggers: [WebhookTriggerEvents.FORM_SUBMITTED], time: null, timeUnit: null, + version: WebhookVersionEnum.V_2021_10_20, }; vi.mocked(getWebhooks).mockResolvedValueOnce([mockWebhook]); diff --git a/packages/features/di/webhooks/Webhooks.tokens.ts b/packages/features/di/webhooks/Webhooks.tokens.ts index 1c7623966f..c3ae329222 100644 --- a/packages/features/di/webhooks/Webhooks.tokens.ts +++ b/packages/features/di/webhooks/Webhooks.tokens.ts @@ -8,13 +8,8 @@ export const WEBHOOK_TOKENS = { OOO_WEBHOOK_SERVICE: Symbol("OOO_WEBHOOK_SERVICE"), WEBHOOK_NOTIFICATION_HANDLER: Symbol("WebhookNotificationHandler"), - // Payload builders - BOOKING_PAYLOAD_BUILDER: Symbol("BookingPayloadBuilder"), - FORM_PAYLOAD_BUILDER: Symbol("FormPayloadBuilder"), - OOO_PAYLOAD_BUILDER: Symbol("OOOPayloadBuilder"), - RECORDING_PAYLOAD_BUILDER: Symbol("RecordingPayloadBuilder"), - MEETING_PAYLOAD_BUILDER: Symbol("MeetingPayloadBuilder"), - INSTANT_MEETING_BUILDER: Symbol("InstantMeetingBuilder"), + // Payload builder factory (versioning) + PAYLOAD_BUILDER_FACTORY: Symbol("PayloadBuilderFactory"), // Repositories WEBHOOK_REPOSITORY: Symbol("IWebhookRepository"), diff --git a/packages/features/di/webhooks/containers/webhook.ts b/packages/features/di/webhooks/containers/webhook.ts index 7070635796..085afce214 100644 --- a/packages/features/di/webhooks/containers/webhook.ts +++ b/packages/features/di/webhooks/containers/webhook.ts @@ -19,12 +19,7 @@ webhookContainer.load(WEBHOOK_TOKENS.BOOKING_WEBHOOK_SERVICE, webhookModule); webhookContainer.load(WEBHOOK_TOKENS.FORM_WEBHOOK_SERVICE, webhookModule); webhookContainer.load(WEBHOOK_TOKENS.RECORDING_WEBHOOK_SERVICE, webhookModule); webhookContainer.load(WEBHOOK_TOKENS.OOO_WEBHOOK_SERVICE, webhookModule); -webhookContainer.load(WEBHOOK_TOKENS.BOOKING_PAYLOAD_BUILDER, webhookModule); -webhookContainer.load(WEBHOOK_TOKENS.FORM_PAYLOAD_BUILDER, webhookModule); -webhookContainer.load(WEBHOOK_TOKENS.OOO_PAYLOAD_BUILDER, webhookModule); -webhookContainer.load(WEBHOOK_TOKENS.RECORDING_PAYLOAD_BUILDER, webhookModule); -webhookContainer.load(WEBHOOK_TOKENS.MEETING_PAYLOAD_BUILDER, webhookModule); -webhookContainer.load(WEBHOOK_TOKENS.INSTANT_MEETING_BUILDER, webhookModule); +webhookContainer.load(WEBHOOK_TOKENS.PAYLOAD_BUILDER_FACTORY, webhookModule); webhookContainer.load(WEBHOOK_TOKENS.WEBHOOK_NOTIFICATION_HANDLER, webhookModule); webhookContainer.load(WEBHOOK_TOKENS.WEBHOOK_NOTIFIER, webhookModule); diff --git a/packages/features/di/webhooks/modules/Webhook.module.ts b/packages/features/di/webhooks/modules/Webhook.module.ts index 986a91239a..e5c61f35d3 100644 --- a/packages/features/di/webhooks/modules/Webhook.module.ts +++ b/packages/features/di/webhooks/modules/Webhook.module.ts @@ -1,11 +1,6 @@ import { createModule } from "@evyweb/ioctopus"; -import { BookingPayloadBuilder } from "@calcom/features/webhooks/lib/factory/BookingPayloadBuilder"; -import { FormPayloadBuilder } from "@calcom/features/webhooks/lib/factory/FormPayloadBuilder"; -import { InstantMeetingBuilder } from "@calcom/features/webhooks/lib/factory/InstantMeetingBuilder"; -import { MeetingPayloadBuilder } from "@calcom/features/webhooks/lib/factory/MeetingPayloadBuilder"; -import { OOOPayloadBuilder } from "@calcom/features/webhooks/lib/factory/OOOPayloadBuilder"; -import { RecordingPayloadBuilder } from "@calcom/features/webhooks/lib/factory/RecordingPayloadBuilder"; +import { createPayloadBuilderFactory } from "@calcom/features/webhooks/lib/factory/versioned/registry"; import { WebhookRepository } from "@calcom/features/webhooks/lib/repository/WebhookRepository"; import { BookingWebhookService } from "@calcom/features/webhooks/lib/service/BookingWebhookService"; import { FormWebhookService } from "@calcom/features/webhooks/lib/service/FormWebhookService"; @@ -54,25 +49,15 @@ webhookModule SHARED_TOKENS.LOGGER, ]); -// Bind payload builders -webhookModule.bind(WEBHOOK_TOKENS.BOOKING_PAYLOAD_BUILDER).toClass(BookingPayloadBuilder); -webhookModule.bind(WEBHOOK_TOKENS.FORM_PAYLOAD_BUILDER).toClass(FormPayloadBuilder); -webhookModule.bind(WEBHOOK_TOKENS.OOO_PAYLOAD_BUILDER).toClass(OOOPayloadBuilder); -webhookModule.bind(WEBHOOK_TOKENS.RECORDING_PAYLOAD_BUILDER).toClass(RecordingPayloadBuilder); -webhookModule.bind(WEBHOOK_TOKENS.MEETING_PAYLOAD_BUILDER).toClass(MeetingPayloadBuilder); -webhookModule.bind(WEBHOOK_TOKENS.INSTANT_MEETING_BUILDER).toClass(InstantMeetingBuilder); +// Bind payload builder factory (composition root for versioning) +webhookModule.bind(WEBHOOK_TOKENS.PAYLOAD_BUILDER_FACTORY).toFactory(() => createPayloadBuilderFactory()); -// Bind notification handler +// Bind notification handler with factory webhookModule .bind(WEBHOOK_TOKENS.WEBHOOK_NOTIFICATION_HANDLER) .toClass(WebhookNotificationHandler, [ WEBHOOK_TOKENS.WEBHOOK_SERVICE, - WEBHOOK_TOKENS.BOOKING_PAYLOAD_BUILDER, - WEBHOOK_TOKENS.FORM_PAYLOAD_BUILDER, - WEBHOOK_TOKENS.OOO_PAYLOAD_BUILDER, - WEBHOOK_TOKENS.RECORDING_PAYLOAD_BUILDER, - WEBHOOK_TOKENS.MEETING_PAYLOAD_BUILDER, - WEBHOOK_TOKENS.INSTANT_MEETING_BUILDER, + WEBHOOK_TOKENS.PAYLOAD_BUILDER_FACTORY, SHARED_TOKENS.LOGGER, ]); diff --git a/packages/features/eventtypes/components/tabs/instant/InstantEventController.tsx b/packages/features/eventtypes/components/tabs/instant/InstantEventController.tsx index a7074a32ef..40baf7b720 100644 --- a/packages/features/eventtypes/components/tabs/instant/InstantEventController.tsx +++ b/packages/features/eventtypes/components/tabs/instant/InstantEventController.tsx @@ -9,11 +9,10 @@ import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequir import useLockedFieldsManager from "@calcom/features/ee/managed-event-types/hooks/useLockedFieldsManager"; import type { EventTypeSetup, FormValues, AvailabilityOption } from "@calcom/features/eventtypes/lib/types"; import { WebhookForm } from "@calcom/features/webhooks/components"; -import type { WebhookFormSubmitData } from "@calcom/features/webhooks/components/WebhookForm"; +import type { TWebhook, WebhookFormSubmitData } from "@calcom/features/webhooks/components/WebhookForm"; import WebhookListItem from "@calcom/features/webhooks/components/WebhookListItem"; import { subscriberUrlReserved } from "@calcom/features/webhooks/lib/subscriberUrlReserved"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import type { Webhook } from "@calcom/prisma/client"; import { WebhookTriggerEvents } from "@calcom/prisma/enums"; import { trpc } from "@calcom/trpc/react"; import classNames from "@calcom/ui/classNames"; @@ -290,7 +289,7 @@ const InstantMeetingWebhooks = ({ eventType }: { eventType: EventTypeSetup }) => const [createModalOpen, setCreateModalOpen] = useState(false); const [editModalOpen, setEditModalOpen] = useState(false); - const [webhookToEdit, setWebhookToEdit] = useState(); + const [webhookToEdit, setWebhookToEdit] = useState(); const editWebhookMutation = trpc.viewer.webhook.edit.useMutation({ async onSuccess() { diff --git a/packages/features/eventtypes/components/tabs/webhooks/EventWebhooksTab.tsx b/packages/features/eventtypes/components/tabs/webhooks/EventWebhooksTab.tsx index cb9b671864..79896dc83c 100644 --- a/packages/features/eventtypes/components/tabs/webhooks/EventWebhooksTab.tsx +++ b/packages/features/eventtypes/components/tabs/webhooks/EventWebhooksTab.tsx @@ -7,12 +7,11 @@ import useLockedFieldsManager from "@calcom/features/ee/managed-event-types/hook import type { FormValues, EventTypeSetupProps } from "@calcom/features/eventtypes/lib/types"; import { WebhookForm } from "@calcom/features/webhooks/components"; import EventTypeWebhookListItem from "@calcom/features/webhooks/components/EventTypeWebhookListItem"; -import type { WebhookFormSubmitData } from "@calcom/features/webhooks/components/WebhookForm"; +import type { TWebhook, WebhookFormSubmitData } from "@calcom/features/webhooks/components/WebhookForm"; import { subscriberUrlReserved } from "@calcom/features/webhooks/lib/subscriberUrlReserved"; import ServerTrans from "@calcom/lib/components/ServerTrans"; import { APP_NAME } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import type { Webhook } from "@calcom/prisma/client"; import { trpc } from "@calcom/trpc/react"; import { Alert } from "@calcom/ui/components/alert"; import { Button } from "@calcom/ui/components/button"; @@ -36,7 +35,7 @@ export const EventWebhooksTab = ({ eventType }: Pick(); + const [webhookToEdit, setWebhookToEdit] = useState(); const editWebhookMutation = trpc.viewer.webhook.edit.useMutation({ async onSuccess() { diff --git a/packages/features/webhooks/components/WebhookForm.tsx b/packages/features/webhooks/components/WebhookForm.tsx index 67dd469add..20417ed704 100644 --- a/packages/features/webhooks/components/WebhookForm.tsx +++ b/packages/features/webhooks/components/WebhookForm.tsx @@ -6,8 +6,9 @@ import { Controller, useForm } from "react-hook-form"; import { TimeTimeUnitInput } from "@calcom/features/ee/workflows/components/TimeTimeUnitInput"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { TimeUnit } from "@calcom/prisma/enums"; -import { WebhookTriggerEvents } from "@calcom/prisma/enums"; +import { TimeUnit, WebhookTriggerEvents } from "@calcom/prisma/enums"; + +import { WebhookVersion } from "../lib/interface/IWebhookRepository"; import type { RouterOutputs } from "@calcom/trpc/react"; import { Button } from "@calcom/ui/components/button"; import { Select } from "@calcom/ui/components/form"; @@ -33,6 +34,7 @@ export type WebhookFormData = { payloadTemplate: string | undefined | null; time?: number | null; timeUnit?: TimeUnit | null; + version: WebhookVersion; }; export type WebhookFormSubmitData = WebhookFormData & { @@ -241,16 +243,21 @@ export type WebhookFormValues = { payloadTemplate: string | undefined | null; time?: number | null; timeUnit?: TimeUnit | null; + version: WebhookVersion; }; const WebhookForm = (props: { - webhook?: WebhookFormData; + webhook?: TWebhook | WebhookFormData; apps?: (keyof typeof WEBHOOK_TRIGGER_EVENTS_GROUPED_BY_APP_V2)[]; overrideTriggerOptions?: (typeof WEBHOOK_TRIGGER_EVENTS_GROUPED_BY_APP_V2)["core"]; onSubmit: (event: WebhookFormSubmitData) => void; onCancel?: () => void; noRoutingFormTriggers: boolean; selectOnlyInstantMeetingOption?: boolean; + headerWrapper?: ( + formMethods: ReturnType>, + children: React.ReactNode + ) => React.ReactNode; }) => { const { apps = [], selectOnlyInstantMeetingOption = false, overrideTriggerOptions } = props; const { t } = useLocale(); @@ -279,7 +286,7 @@ const WebhookForm = (props: { ).map((option) => option.value); }; - const formMethods = useForm({ + const formMethods = useForm({ defaultValues: { subscriberUrl: props.webhook?.subscriberUrl || "", active: props.webhook ? props.webhook.active : true, @@ -288,9 +295,12 @@ const WebhookForm = (props: { payloadTemplate: props?.webhook?.payloadTemplate || undefined, timeUnit: props?.webhook?.timeUnit || undefined, time: props?.webhook?.time || undefined, + version: props?.webhook?.version || WebhookVersion.V_2021_10_20, }, }); + formMethods.register("version"); + const triggers = formMethods.watch("eventTriggers") || []; const subscriberUrl = formMethods.watch("subscriberUrl"); const time = formMethods.watch("time"); @@ -353,267 +363,274 @@ const WebhookForm = (props: { } }, [changeSecret, formMethods]); - return ( + const formContent = (
props.onSubmit({ ...values, changeSecret, newSecret })}> -
- ( - <> - { - formMethods.setValue("subscriberUrl", e?.target.value, { shouldDirty: true }); - if (hasTemplateIntegration({ url: e.target.value })) { - setUseCustomTemplate(true); - formMethods.setValue("payloadTemplate", customTemplate({ url: e.target.value }), { - shouldDirty: true, - }); - } - }} - /> - - )} - /> - ( -
- { - formMethods.setValue("active", value, { shouldDirty: true }); - }} - /> -
- )} - /> - { - const selectValue = translatedTriggerOptions.filter((option) => value.includes(option.value)); - return ( -
- -