From 32b42adfbc8a60bdfc3eed4a2fec3af433d3042f Mon Sep 17 00:00:00 2001 From: Madison Date: Thu, 11 Sep 2025 15:37:42 -0500 Subject: [PATCH] [Dashboard][UI] - User's teams on profile page (#885) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds new team section on user profile pages in the dashboard. ---- > [!IMPORTANT] > Adds a new `UserTeamsSection` to display user's teams on the profile page in `page-client.tsx`. > > - **New Features**: > - Adds `UserTeamsSection` component in `page-client.tsx` to display user's teams on profile page. > - Displays a table with Team ID, Display Name, Created At, and an action to open each team in a new tab. > - Shows an empty-state card when no teams are found. > - Integrated the section after the `ContactChannelsSection` on the user page. > > This description was created by [Ellipsis](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral) for e3080a923cd354661810f91131329c13adbe3ae4. You can [customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this summary. It will automatically update as commits are pushed. ---- ## Review by RecurseML _🔍 Review performed on [9318e2b..7b9e098](https://github.com/stack-auth/stack-auth/compare/9318e2b6ce47bbca5bc524cf8fd75e7ea0d7ee28...7b9e098b22c720fc6e343bb8e0c414571f6eee95)_ ✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (1) • `apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx`
[![Need help? Join our Discord](https://img.shields.io/badge/Need%20help%3F%20Join%20our%20Discord-5865F2?style=plastic&logo=discord&logoColor=white)](https://discord.gg/n3SsVDAW6U) ## Summary by CodeRabbit * **New Features** * Added a "Teams" section to the user page showing teams the user belongs to. * Displays a table with Team ID, Display Name, Created At, and an action to open each team in a new tab. * Shows an empty-state card when no teams are found. * Integrated the section after the Contact Channels area on the user page. --------- Co-authored-by: Konsti Wohlwend --- .../users/[userId]/page-client.tsx | 76 ++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx index afc761c62..475a15fb9 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/users/[userId]/page-client.tsx @@ -854,6 +854,80 @@ function ContactChannelsSection({ user }: ContactChannelsSectionProps) { ); } +type UserTeamsSectionProps = { + user: ServerUser, +}; + +function UserTeamsSection({ user }: UserTeamsSectionProps) { + const stackAdminApp = useAdminApp(); + const teams = user.useTeams(); + + return ( +
+
+
+

Teams

+

Teams this user belongs to

+
+
+ + {teams.length === 0 ? ( +
+

+ No teams found +

+
+ ) : ( +
+ + + + Team ID + Display Name + Created At + + + + + {teams.map((team) => ( + + +
+ {team.id} +
+
+ +
+ {team.displayName || '-'} +
+
+ +
+ {team.createdAt.toLocaleDateString()} +
+
+ + { + window.open(`/projects/${stackAdminApp.projectId}/teams/${team.id}`, '_blank', 'noopener'); + }, + }, + ]} + /> + +
+ ))} +
+
+
+ )} +
+ ); +} + type OAuthProvidersSectionProps = { user: ServerUser, }; @@ -1230,8 +1304,8 @@ function UserPage({ user }: { user: ServerUser }) { + -