From 6cbb9bf9675b7d61e9af762c726c812c93bb8980 Mon Sep 17 00:00:00 2001 From: "GitStart-Cal.com" <121884634+gitstart-calcom@users.noreply.github.com> Date: Wed, 29 Mar 2023 05:44:45 +0000 Subject: [PATCH] CALCOM-7857 - [CAL-1303] UI issues webhook list (#7968) Co-authored-by: gitstart-calcom --- .../webhooks/components/WebhookListItem.tsx | 62 +++++++++++++++---- 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/packages/features/webhooks/components/WebhookListItem.tsx b/packages/features/webhooks/components/WebhookListItem.tsx index f332157262..3440865bb6 100644 --- a/packages/features/webhooks/components/WebhookListItem.tsx +++ b/packages/features/webhooks/components/WebhookListItem.tsx @@ -3,8 +3,20 @@ import type { WebhookTriggerEvents } from "@prisma/client"; import classNames from "@calcom/lib/classNames"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; -import { Badge, Button, showToast, Switch, Tooltip } from "@calcom/ui"; -import { FiAlertCircle, FiTrash } from "@calcom/ui/components/icon"; +import { + Badge, + Button, + Dropdown, + DropdownItem, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, + DropdownMenuSeparator, + showToast, + Switch, + Tooltip, +} from "@calcom/ui"; +import { FiAlertCircle, FiEdit, FiMoreHorizontal, FiTrash } from "@calcom/ui/components/icon"; type WebhookProps = { id: string; @@ -39,21 +51,30 @@ export default function WebhookListItem(props: { }, }); + const onDeleteWebhook = () => { + // TODO: Confimation dialog before deleting + deleteWebhook.mutate({ id: webhook.id, eventTypeId: webhook.eventTypeId || undefined }); + }; + return (
-
-

{webhook.subscriberUrl}

+
+

{webhook.subscriberUrl}

-
+
{webhook.eventTriggers.map((trigger) => ( - + {t(`${trigger.toLowerCase()}`)} ))}
-
+
@@ -65,18 +86,35 @@ export default function WebhookListItem(props: { }) } /> -
);