From 6174833dc205711bbfb7f8675927d8b8a5d65c5f Mon Sep 17 00:00:00 2001 From: "Muhamade Sabith .T.U" Date: Fri, 27 Oct 2023 19:54:21 +0530 Subject: [PATCH] feat/webhooks --- web/components/web-hooks/empty-webhooks.tsx | 20 ++++ web/components/web-hooks/index.js | 4 + web/components/web-hooks/webhook-details.tsx | 99 +++++++++++++++++++ .../web-hooks/webhooks-list-item.tsx | 19 ++++ web/components/web-hooks/webhooks-list.tsx | 25 +++++ .../workspace-setting-layout/sidebar.tsx | 4 + .../[workspaceSlug]/settings/webhooks.tsx | 22 +++++ 7 files changed, 193 insertions(+) create mode 100644 web/components/web-hooks/empty-webhooks.tsx create mode 100644 web/components/web-hooks/index.js create mode 100644 web/components/web-hooks/webhook-details.tsx create mode 100644 web/components/web-hooks/webhooks-list-item.tsx create mode 100644 web/components/web-hooks/webhooks-list.tsx create mode 100644 web/pages/[workspaceSlug]/settings/webhooks.tsx diff --git a/web/components/web-hooks/empty-webhooks.tsx b/web/components/web-hooks/empty-webhooks.tsx new file mode 100644 index 000000000..95439c63c --- /dev/null +++ b/web/components/web-hooks/empty-webhooks.tsx @@ -0,0 +1,20 @@ +import React from "react"; +import { Button } from "@plane/ui"; +import Image from "next/image"; +import EmptyWebhookLogo from "public/empty-state/issue.svg"; + +export const EmptyWebhooks = () => { + return ( +
+
+ empty-webhook image + +

No Webhooks yet

+

Create labels to help organize and filter issues in your project

+ +
+
+ ); +}; diff --git a/web/components/web-hooks/index.js b/web/components/web-hooks/index.js new file mode 100644 index 000000000..35ba2f597 --- /dev/null +++ b/web/components/web-hooks/index.js @@ -0,0 +1,4 @@ +export * from "./empty-webhooks"; +export * from "./webhooks-list"; +export * from "./webhooks-list-item"; +export * from "./webhook-details"; diff --git a/web/components/web-hooks/webhook-details.tsx b/web/components/web-hooks/webhook-details.tsx new file mode 100644 index 000000000..c32d59d64 --- /dev/null +++ b/web/components/web-hooks/webhook-details.tsx @@ -0,0 +1,99 @@ +import React, { useState } from "react"; +import { Button, ToggleSwitch } from "@plane/ui"; +import { RefreshCw } from "lucide-react"; + +export const WebhookDetails = () => { + const [isIndividualEventsSelected, setIndividualEventsSelected] = useState(false); + const [isWebhookEnabled, setWebhookEnabled] = useState(false); + const [isRegenarateKeyLoading, setRegenarateKeyLoading] = useState(false); + const [showGenaratedKey, setShowGenaratedKey] = useState(true); + return ( + <> +
+

Webhook Name

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore + magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex. +

+
+

URL

+ + {/* WebHook toggle */} +
+

Enable webhook

+ setWebhookEnabled(value)} /> +
+

Which event do you like to trigger this webhook

+ + {/* Radio */} + setIndividualEventsSelected(value.target.value == "individual")} + /> + + +
+ setIndividualEventsSelected(value.target.value == "individual")} + className="w-3.5 mt-5 mb-2" + /> + + + {/* Grid */} + {isIndividualEventsSelected && ( +
+
+ {" "} +
+
+ {" "} +
+
+ +
+
+ +
+
+ +
+
+ )} +

Secret Key

+

Genarate a token to sign-in the webhook payload

+
+
+ {showGenaratedKey && ( +
+
+
+
+
+ + +
+
+
+ +
+ )} + +
+ + ); +}; diff --git a/web/components/web-hooks/webhooks-list-item.tsx b/web/components/web-hooks/webhooks-list-item.tsx new file mode 100644 index 000000000..e5c61d9d2 --- /dev/null +++ b/web/components/web-hooks/webhooks-list-item.tsx @@ -0,0 +1,19 @@ +import React from "react"; +import { ToggleSwitch } from "@plane/ui"; + +export const WebhooksListItem = () => { + return ( +
+ {/*
*/} +
+
+

Webhook Name

+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor +
+
+ console.log("change")} /> +
+
+ ); +}; diff --git a/web/components/web-hooks/webhooks-list.tsx b/web/components/web-hooks/webhooks-list.tsx new file mode 100644 index 000000000..57206268a --- /dev/null +++ b/web/components/web-hooks/webhooks-list.tsx @@ -0,0 +1,25 @@ +import React from "react"; +import { Button } from "@plane/ui"; +import { WebhooksListItem } from "./webhooks-list-item"; + +export const WebhookLists = () => { + return ( +
+
+

Webhooks

+ +
+ {/* List */} +
+ + + + + + +
+
+ ); +}; diff --git a/web/layouts/setting-layout/workspace-setting-layout/sidebar.tsx b/web/layouts/setting-layout/workspace-setting-layout/sidebar.tsx index caf4f8358..785951136 100644 --- a/web/layouts/setting-layout/workspace-setting-layout/sidebar.tsx +++ b/web/layouts/setting-layout/workspace-setting-layout/sidebar.tsx @@ -26,6 +26,10 @@ export const WorkspaceSettingsSidebar = () => { label: "Integrations", href: `/${workspaceSlug}/settings/integrations`, }, + { + label: "Webhooks", + href: `/${workspaceSlug}/settings/webhooks`, + }, { label: "Imports", href: `/${workspaceSlug}/settings/imports`, diff --git a/web/pages/[workspaceSlug]/settings/webhooks.tsx b/web/pages/[workspaceSlug]/settings/webhooks.tsx new file mode 100644 index 000000000..5b6509667 --- /dev/null +++ b/web/pages/[workspaceSlug]/settings/webhooks.tsx @@ -0,0 +1,22 @@ +import React from "react"; +import type { NextPage } from "next"; +import { AppLayout } from "layouts/app-layout"; +import { WorkspaceSettingHeader } from "components/headers"; +import { WorkspaceSettingLayout } from "layouts/setting-layout"; +import { EmptyWebhooks, WebhookLists, WebhookDetails } from "components/web-hooks"; + +const Webhooks: NextPage = () => { + return ( + }> + +
+ {/* */} + {/* */} + +
+
+
+ ); +}; + +export default Webhooks;