diff --git a/messages/en-US.json b/messages/en-US.json index 562977b3..411fbb12 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -285,5 +285,17 @@ "apiKeysDeleteConfirm": "Confirm Delete API Key", "apiKeysDelete": "Delete API Key", "apiKeysManage": "Manage API Keys", - "apiKeysDescription": "API keys are used to authenticate with the integration API" + "apiKeysDescription": "API keys are used to authenticate with the integration API", + "userTitle": "Manage All Users", + "userDescription": "View and manage all users in the system", + "userAbount": "About User Management", + "userAbountDescription": "This table displays all root user objects in the system. Each user may belong to multiple organizations. Removing a user from an organization does not delete their root user object - they will remain in the system. To completely remove a user from the system, you must delete their root user object using the delete action in this table.", + "userServer": "Server Users", + "userSearch": "Search server users...", + "userErrorDelete": "Error deleting user", + "userDeleteConfirm": "Confirm Delete User", + "userDeleteServer": "Delete User from Server", + "userMessageRemove": "The user will be removed from all organizations and be completely removed from the server.", + "userMessageConfirm": "To confirm, please type the name of the user below.", + "userQuestionRemove": "Are you sure you want to permanently delete {selectedUser} from the server?" } diff --git a/src/app/admin/users/AdminUsersDataTable.tsx b/src/app/admin/users/AdminUsersDataTable.tsx index 7532a8cc..3a1e85cf 100644 --- a/src/app/admin/users/AdminUsersDataTable.tsx +++ b/src/app/admin/users/AdminUsersDataTable.tsx @@ -4,6 +4,7 @@ import { ColumnDef, } from "@tanstack/react-table"; import { DataTable } from "@app/components/ui/data-table"; +import { useTranslations } from 'next-intl'; interface DataTableProps { columns: ColumnDef[]; @@ -14,12 +15,15 @@ export function UsersDataTable({ columns, data }: DataTableProps) { + + const t = useTranslations(); + return ( ); diff --git a/src/app/admin/users/AdminUsersTable.tsx b/src/app/admin/users/AdminUsersTable.tsx index 68ad2790..f8cc7506 100644 --- a/src/app/admin/users/AdminUsersTable.tsx +++ b/src/app/admin/users/AdminUsersTable.tsx @@ -11,6 +11,7 @@ import { toast } from "@app/hooks/useToast"; import { formatAxiosError } from "@app/lib/api"; import { createApiClient } from "@app/lib/api"; import { useEnvContext } from "@app/hooks/useEnvContext"; +import { useTranslations } from 'next-intl'; export type GlobalUserRow = { id: string; @@ -29,6 +30,7 @@ type Props = { export default function UsersTable({ users }: Props) { const router = useRouter(); + const t = useTranslations(); const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); const [selected, setSelected] = useState(null); @@ -42,8 +44,8 @@ export default function UsersTable({ users }: Props) { console.error("Error deleting user", e); toast({ variant: "destructive", - title: "Error deleting user", - description: formatAxiosError(e, "Error deleting user") + title: t('userErrorDelete'), + description: formatAxiosError(e, t('userErrorDelete')) }); }) .then(() => { @@ -82,7 +84,7 @@ export default function UsersTable({ users }: Props) { column.toggleSorting(column.getIsSorted() === "asc") } > - Username + {t('username')} ); @@ -98,7 +100,7 @@ export default function UsersTable({ users }: Props) { column.toggleSorting(column.getIsSorted() === "asc") } > - Email + {t('email')} ); @@ -114,7 +116,7 @@ export default function UsersTable({ users }: Props) { column.toggleSorting(column.getIsSorted() === "asc") } > - Name + {t('name')} ); @@ -130,7 +132,7 @@ export default function UsersTable({ users }: Props) { column.toggleSorting(column.getIsSorted() === "asc") } > - Identity Provider + {t('identityProvider')} ); @@ -151,7 +153,7 @@ export default function UsersTable({ users }: Props) { setIsDeleteModalOpen(true); }} > - Delete + {t('delete')} @@ -172,35 +174,26 @@ export default function UsersTable({ users }: Props) { dialog={

- Are you sure you want to permanently delete{" "} - - {selected?.email || - selected?.name || - selected?.username} - {" "} - from the server? + {t('userQuestionRemove', {selectedUser: selected?.email || selected?.name || selected?.username})}

- The user will be removed from all - organizations and be completely removed from - the server. + {t('userMessageRemove')}

- To confirm, please type the name of the user - below. + {t('userMessageConfirm')}

} - buttonText="Confirm Delete User" + buttonText={t('userDeleteConfirm')} onConfirm={async () => deleteUser(selected!.id)} string={ selected.email || selected.name || selected.username } - title="Delete User from Server" + title={t('userDeleteServer')} /> )} diff --git a/src/app/admin/users/page.tsx b/src/app/admin/users/page.tsx index 6e2290cb..9a840105 100644 --- a/src/app/admin/users/page.tsx +++ b/src/app/admin/users/page.tsx @@ -6,6 +6,7 @@ import { AdminListUsersResponse } from "@server/routers/user/adminListUsers"; import UsersTable, { GlobalUserRow } from "./AdminUsersTable"; import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert"; import { InfoIcon } from "lucide-react"; +import { getTranslations } from 'next-intl/server'; type PageProps = { params: Promise<{ orgId: string }>; @@ -39,17 +40,19 @@ export default async function UsersPage(props: PageProps) { }; }); + const t = await getTranslations(); + return ( <> - About User Management + {t('userAbount')} - This table displays all root user objects in the system. Each user may belong to multiple organizations. Removing a user from an organization does not delete their root user object - they will remain in the system. To completely remove a user from the system, you must delete their root user object using the delete action in this table. + {t('userAbountDescription')}