From 575d703a3908573c6ce541187214ffa9cd814d84 Mon Sep 17 00:00:00 2001 From: David Gu Date: Fri, 14 Nov 2025 15:11:53 -0500 Subject: [PATCH 1/9] Added state variables for the modal --- bun.lock | 3 --- .../analyticsConfigTable/analytics-action-cell.tsx | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bun.lock b/bun.lock index ba27b5f..2e890b1 100644 --- a/bun.lock +++ b/bun.lock @@ -21,7 +21,6 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "1.0.0", - "jose": "^6.0.10", "juno-sdk": "link:juno-sdk", "lucide-react": "^0.487.0", "next": "15.2.3", @@ -702,8 +701,6 @@ "jiti": ["jiti@1.21.7", "", { "bin": "bin/jiti.js" }, "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A=="], - "jose": ["jose@6.0.10", "", {}, "sha512-skIAxZqcMkOrSwjJvplIPYrlXGpxTPnro2/QWTDCxAdWQrSTV5/KqspMWmi5WAx5+ULswASJiZ0a+1B/Lxt9cw=="], - "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], "js-yaml": ["js-yaml@4.1.0", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": "bin/js-yaml.js" }, "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA=="], diff --git a/src/components/analyticsConfigTable/analytics-action-cell.tsx b/src/components/analyticsConfigTable/analytics-action-cell.tsx index 6606f5f..d77e582 100644 --- a/src/components/analyticsConfigTable/analytics-action-cell.tsx +++ b/src/components/analyticsConfigTable/analytics-action-cell.tsx @@ -18,6 +18,7 @@ import { import { MoreHorizontal } from "lucide-react"; import AddAnalyticsConfigForm from "../forms/AddAnalyticsConfigForm"; import { AnalyticsConfig } from "./columns"; +import { useState } from "react"; interface AnalyticsActionsCellProps { config: AnalyticsConfig; @@ -38,9 +39,11 @@ export const AnalyticsActionsCell = ({ isPending, onUpdateConfig, }: AnalyticsActionsCellProps) => { + const [isDialogOpen, setIsDialogOpen] = useState(false); + return ( <> - + - - - e.stopPropagation()} - className="cursor-pointer" - > - Edit config - - - + + + + + + { + e.stopPropagation(); + setIsDialogOpen(true); + }} + className="cursor-pointer" + > + Edit config + + + + Edit Config From cdf7ee3a48f196e1eb9ae48075568583d73cb3a2 Mon Sep 17 00:00:00 2001 From: David Gu Date: Sat, 7 Feb 2026 17:19:54 -0500 Subject: [PATCH 5/9] Fix slight check issue in link user --- src/components/forms/EditUserForm.tsx | 48 +++++++++++++++++---------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/src/components/forms/EditUserForm.tsx b/src/components/forms/EditUserForm.tsx index a9708b9..512be80 100644 --- a/src/components/forms/EditUserForm.tsx +++ b/src/components/forms/EditUserForm.tsx @@ -99,26 +99,38 @@ const EditUserForm = ({ ); // Unlink projects that were removed - const unlinkPromises = projectsToUnlink.map((projectId) => { - const projectName = projectData.find( - (p) => parseInt(p.id) === parseInt(projectId), - )?.name; - return unlinkUserFromProject({ - projectName, - userId: initialUserData.id.toString(), - }); - }); + const unlinkPromises = projectsToUnlink + .map((projectId) => { + const projectName = projectData.find( + (p) => parseInt(p.id) === parseInt(projectId), + )?.name; + if (!projectName) { + console.error(`Project with ID ${projectId} not found`); + return null; + } + return unlinkUserFromProject({ + projectName, + userId: initialUserData.id.toString(), + }); + }) + .filter((promise) => promise !== null); // Link projects that were added - const linkPromises = projectsToLink.map((projectId) => { - const projectName = projectData.find( - (p) => parseInt(p.id) === parseInt(projectId), - )?.name; - return linkUserToProject({ - projectName, - userId: initialUserData.id.toString(), - }); - }); + const linkPromises = projectsToLink + .map((projectId) => { + const projectName = projectData.find( + (p) => parseInt(p.id) === parseInt(projectId), + )?.name; + if (!projectName) { + console.error(`Project with ID ${projectId} not found`); + return null; + } + return linkUserToProject({ + projectName, + userId: initialUserData.id.toString(), + }); + }) + .filter((promise) => promise !== null); // Execute all project operations const unlinkResults = await Promise.all(unlinkPromises); From a6ac8102ce8d5918220d5c9e4cddd097aac91735 Mon Sep 17 00:00:00 2001 From: David Gu Date: Sat, 7 Feb 2026 17:30:53 -0500 Subject: [PATCH 6/9] Commented out console errors --- src/components/forms/EditUserForm.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/forms/EditUserForm.tsx b/src/components/forms/EditUserForm.tsx index 512be80..e9701bf 100644 --- a/src/components/forms/EditUserForm.tsx +++ b/src/components/forms/EditUserForm.tsx @@ -105,7 +105,7 @@ const EditUserForm = ({ (p) => parseInt(p.id) === parseInt(projectId), )?.name; if (!projectName) { - console.error(`Project with ID ${projectId} not found`); + // console.error(`Project with ID ${projectId} not found`); return null; } return unlinkUserFromProject({ @@ -122,7 +122,7 @@ const EditUserForm = ({ (p) => parseInt(p.id) === parseInt(projectId), )?.name; if (!projectName) { - console.error(`Project with ID ${projectId} not found`); + // console.error(`Project with ID ${projectId} not found`); return null; } return linkUserToProject({ From 13ac0f48453e03a03103a0daeed0bafc53a1433d Mon Sep 17 00:00:00 2001 From: David Gu Date: Sat, 7 Feb 2026 17:31:11 -0500 Subject: [PATCH 7/9] linting --- src/components/analyticsConfigTable/analytics-action-cell.tsx | 2 +- src/components/ui/badge.tsx | 3 ++- src/components/ui/button.tsx | 3 ++- src/components/ui/sheet.tsx | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/analyticsConfigTable/analytics-action-cell.tsx b/src/components/analyticsConfigTable/analytics-action-cell.tsx index f2d067a..8c46748 100644 --- a/src/components/analyticsConfigTable/analytics-action-cell.tsx +++ b/src/components/analyticsConfigTable/analytics-action-cell.tsx @@ -28,7 +28,7 @@ interface AnalyticsActionsCellProps { keys: { serverAnalyticsKey: string; clientAnalyticsKey: string; - } + }, ) => void; } diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx index f795980..c660d91 100644 --- a/src/components/ui/badge.tsx +++ b/src/components/ui/badge.tsx @@ -24,7 +24,8 @@ const badgeVariants = cva( ); export interface BadgeProps - extends React.HTMLAttributes, + extends + React.HTMLAttributes, VariantProps {} function Badge({ className, variant, ...props }: BadgeProps) { diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 961fe42..bf1d595 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -35,7 +35,8 @@ const buttonVariants = cva( ); export interface ButtonProps - extends React.ButtonHTMLAttributes, + extends + React.ButtonHTMLAttributes, VariantProps { asChild?: boolean; } diff --git a/src/components/ui/sheet.tsx b/src/components/ui/sheet.tsx index ad1a8b8..adcf7e0 100644 --- a/src/components/ui/sheet.tsx +++ b/src/components/ui/sheet.tsx @@ -50,7 +50,8 @@ const sheetVariants = cva( ); interface SheetContentProps - extends React.ComponentPropsWithoutRef, + extends + React.ComponentPropsWithoutRef, VariantProps {} const SheetContent = React.forwardRef< From 13524c48046085c6206fcd8b3b82cca7ff5841e2 Mon Sep 17 00:00:00 2001 From: Long Lam Date: Mon, 23 Feb 2026 23:00:13 -0500 Subject: [PATCH 8/9] fix: format --- src/components/ui/badge.tsx | 3 +-- src/components/ui/button.tsx | 3 +-- src/components/ui/sheet.tsx | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx index c660d91..f795980 100644 --- a/src/components/ui/badge.tsx +++ b/src/components/ui/badge.tsx @@ -24,8 +24,7 @@ const badgeVariants = cva( ); export interface BadgeProps - extends - React.HTMLAttributes, + extends React.HTMLAttributes, VariantProps {} function Badge({ className, variant, ...props }: BadgeProps) { diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index bf1d595..961fe42 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -35,8 +35,7 @@ const buttonVariants = cva( ); export interface ButtonProps - extends - React.ButtonHTMLAttributes, + extends React.ButtonHTMLAttributes, VariantProps { asChild?: boolean; } diff --git a/src/components/ui/sheet.tsx b/src/components/ui/sheet.tsx index adcf7e0..ad1a8b8 100644 --- a/src/components/ui/sheet.tsx +++ b/src/components/ui/sheet.tsx @@ -50,8 +50,7 @@ const sheetVariants = cva( ); interface SheetContentProps - extends - React.ComponentPropsWithoutRef, + extends React.ComponentPropsWithoutRef, VariantProps {} const SheetContent = React.forwardRef< From 3d134e818e55a6f3d5e9712275f660294ee04e47 Mon Sep 17 00:00:00 2001 From: Long Lam Date: Sun, 12 Apr 2026 22:31:38 -0400 Subject: [PATCH 9/9] fix: format --- .../analytics-action-cell.tsx | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/components/analyticsConfigTable/analytics-action-cell.tsx b/src/components/analyticsConfigTable/analytics-action-cell.tsx index 3a61955..11d5df6 100644 --- a/src/components/analyticsConfigTable/analytics-action-cell.tsx +++ b/src/components/analyticsConfigTable/analytics-action-cell.tsx @@ -44,29 +44,25 @@ export const AnalyticsActionsCell = ({ return ( <> - - - - - - { + + + + + + { e.stopPropagation(); setIsDialogOpen(true); }} - className="cursor-pointer" - > - Edit config - - - + className="cursor-pointer" + > + Edit config + + +