From a41ed5d72a0bdf0c9763e2fb0ee46ebe4f7c26e0 Mon Sep 17 00:00:00 2001 From: tedspare Date: Wed, 22 Nov 2023 21:15:36 -0500 Subject: [PATCH 1/6] Allow syncing projects to milestones --- components/Dashboard.tsx | 131 ++++++++++++++++++++++---------- utils/github.ts | 8 +- utils/linear.ts | 26 +------ utils/webhook/linear.handler.ts | 59 ++++++++------ 4 files changed, 131 insertions(+), 93 deletions(-) diff --git a/components/Dashboard.tsx b/components/Dashboard.tsx index 982b70f..11f820a 100644 --- a/components/Dashboard.tsx +++ b/components/Dashboard.tsx @@ -1,16 +1,36 @@ import { Cross1Icon, InfoCircledIcon, WidthIcon } from "@radix-ui/react-icons"; -import React, { useContext, useState } from "react"; +import React, { useContext, useEffect, useState } from "react"; import { LINEAR } from "../utils/constants"; import { updateGitHubWebhook } from "../utils/github"; -import { updateLinearWebhook } from "../utils/linear"; +import { getLinearWebhook, updateLinearWebhook } from "../utils/linear"; import { Context } from "./ContextProvider"; import Tooltip from "./Tooltip"; +const options = ["Cycle", "Project"] as const; +type Option = (typeof options)[number]; + const Dashboard = () => { const { syncs, setSyncs, gitHubContext, linearContext } = useContext(Context); const [loading, setLoading] = useState(false); + const [milestoneAction, setMilestoneAction] = useState