diff --git a/web/components/web-hooks/form/form.tsx b/web/components/web-hooks/form/form.tsx index 87c40107c..1c6f24a5d 100644 --- a/web/components/web-hooks/form/form.tsx +++ b/web/components/web-hooks/form/form.tsx @@ -138,29 +138,35 @@ export const WebhookForm: FC = observer((props) => { return (
{data ? "Webhook details" : "Create webhook"}
-
-
- ( - - )} - /> - {errors.url &&
{errors.url.message}
} + +
+
+ ( + + )} + /> + {errors.url &&
{errors.url.message}
} +
+ {data && } +
+ setWebhookEventType(val)} /> +
- {data && } -
- setWebhookEventType(val)} /> +
+ {webhookEventType === "individual" && } +
+
+ {data && } +
- {webhookEventType === "individual" && } - {data && } -
); diff --git a/web/components/web-hooks/form/individual-event-options.tsx b/web/components/web-hooks/form/individual-event-options.tsx index 6c6302fea..4e88891d0 100644 --- a/web/components/web-hooks/form/individual-event-options.tsx +++ b/web/components/web-hooks/form/individual-event-options.tsx @@ -1,7 +1,7 @@ import { Control, Controller } from "react-hook-form"; import { IWebhook } from "types/webhook"; -export const individualWebhookOptions: { +export const INDIVIDUAL_WEBHOOK_OPTIONS: { key: keyof IWebhook; label: string; description: string; @@ -9,27 +9,27 @@ export const individualWebhookOptions: { { key: "project", label: "Projects", - description: "Project created, updated or deleted.", + description: "Project created, updated, or deleted", }, { key: "cycle", label: "Cycles", - description: "Cycle created, updated or deleted.", + description: "Cycle created, updated, or deleted", }, { key: "issue", label: "Issues", - description: "Issue created, updated, deleted, added to a cycle or module.", + description: "Issue created, updated, deleted, added to a cycle or module", }, { key: "module", label: "Modules", - description: "Module created, updated or deleted.", + description: "Module created, updated, or deleted", }, { key: "issue_comment", label: "Issue comments", - description: "Comment posted, updated or deleted.", + description: "Comment posted, updated, or deleted", }, ]; @@ -38,32 +38,30 @@ type Props = { }; export const WebhookIndividualEventOptions = ({ control }: Props) => ( - <> -
- {individualWebhookOptions.map((option) => ( - ( -
-
- onChange(!value)} - type="checkbox" - name="selectIndividualEvents" - checked={value === true} - /> - -
-

{option.description}

+
+ {INDIVIDUAL_WEBHOOK_OPTIONS.map((option) => ( + ( +
+
+ onChange(!value)} + type="checkbox" + name="selectIndividualEvents" + checked={value === true} + /> +
- )} - /> - ))} -
- +

{option.description}

+
+ )} + /> + ))} +
);