From 389a69484e8cd67e4fe6beb42a5ece28291e3b56 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Fri, 13 Feb 2026 00:25:02 -0600 Subject: [PATCH] refactor(sidebar): streamline organization dropdown menu interactions - Simplified the organization selection process by enhancing the dropdown menu structure. - Improved the layout for better visibility and usability, ensuring a smoother user experience when setting default organizations and deleting them. - Added error handling for organization actions to provide user feedback on success or failure. --- apps/dokploy/components/layouts/side.tsx | 222 +++++++++++------------ 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/apps/dokploy/components/layouts/side.tsx b/apps/dokploy/components/layouts/side.tsx index 0e7d0b9d0..4b3354ed8 100644 --- a/apps/dokploy/components/layouts/side.tsx +++ b/apps/dokploy/components/layouts/side.tsx @@ -640,126 +640,126 @@ function SidebarLogo() {
{organizations?.map((org) => { - const isDefault = org.members?.[0]?.isDefault ?? false; - return ( -
- { - await authClient.organization.setActive({ - organizationId: org.id, - }); - window.location.reload(); - }} - className="w-full gap-2 p-2" + const isDefault = org.members?.[0]?.isDefault ?? false; + return ( +
-
-
- {org.name} -
-
-
- -
- - -
-
+
+ - ) : ( - - )} - - {org.ownerId === session?.user?.id && ( - <> - - { - await deleteOrganization({ - organizationId: org.id, +
+ + +
+ + {org.ownerId === session?.user?.id && ( + <> + + { + await deleteOrganization({ + organizationId: org.id, }) - .catch((error) => { - toast.error( - error?.message || - "Error deleting organization", - ); - }); - }} - > - - - - )} + + + + )} +
-
- ); - })} + ); + })}
{(user?.role === "owner" || user?.role === "admin" ||