From 0a960032c44cc022e6179e0ce544362baf6a7674 Mon Sep 17 00:00:00 2001 From: Mish Ushakov Date: Tue, 3 Dec 2024 23:02:23 +0100 Subject: [PATCH 1/4] add added by and added at fields to table, changes to API header --- apps/web/src/components/Dashboard/Team.tsx | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/apps/web/src/components/Dashboard/Team.tsx b/apps/web/src/components/Dashboard/Team.tsx index 98aedb9ed..a612f614e 100644 --- a/apps/web/src/components/Dashboard/Team.tsx +++ b/apps/web/src/components/Dashboard/Team.tsx @@ -22,13 +22,17 @@ import { AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, - AlertDialogTrigger, } from '../ui/alert-dialog' import Spinner from '@/components/Spinner' interface TeamMember { id: string email: string + addedBy: { + id: string + email: string + } | null + addedAt: string } const emailRegex = new RegExp( @@ -62,7 +66,7 @@ export const TeamContent = ({ `${process.env.NEXT_PUBLIC_BILLING_API_URL}/teams/${team.id}/users`, { headers: { - 'X-Team-API-Key': team.apiKeys[0], + 'X-User-Access-Token': user.accessToken, }, } ) @@ -261,6 +265,8 @@ export const TeamContent = ({ Email + Added by + Added at @@ -278,13 +284,14 @@ export const TeamContent = ({ key={user.id} > {user.email} - + {user.addedBy?.email} + {user.addedAt} + @@ -295,18 +302,13 @@ export const TeamContent = ({ )} - - - - You are about to delete a member from the team + You are about to remove a member from the team - This action cannot be undone. This will permanently delete the + This action cannot be undone. This will permanently remove the member from the team. @@ -321,7 +323,7 @@ export const TeamContent = ({ className="bg-red-500 text-white hover:bg-red-600" onClick={() => deleteUserFromTeam()} > - Continue + Remove From 686f56982206c498ea05612a90a983a8c5e3243b Mon Sep 17 00:00:00 2001 From: Mish Ushakov Date: Thu, 5 Dec 2024 17:33:29 +0100 Subject: [PATCH 2/4] user.addedAt toLocaleString --- apps/web/src/components/Dashboard/Team.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/Dashboard/Team.tsx b/apps/web/src/components/Dashboard/Team.tsx index a612f614e..facba8b4a 100644 --- a/apps/web/src/components/Dashboard/Team.tsx +++ b/apps/web/src/components/Dashboard/Team.tsx @@ -285,7 +285,9 @@ export const TeamContent = ({ > {user.email} {user.addedBy?.email} - {user.addedAt} + + {new Date(user.addedAt).toLocaleString()} +