diff --git a/scripts/hydrate.ts b/scripts/hydrate.ts index 9c278539..bf3f7111 100644 --- a/scripts/hydrate.ts +++ b/scripts/hydrate.ts @@ -1,6 +1,6 @@ // import { orgs, sites, resources, exitNodes, targets } from "@server/db/schema"; // import db from "@server/db"; -// import { crateAdminRole } from "@server/db/ensureActions"; +// import { createAdminRole } from "@server/db/ensureActions"; // async function insertDummyData() { // const org1 = db @@ -13,7 +13,7 @@ // .returning() // .get(); -// await crateAdminRole(org1.orgId!); +// await createAdminRole(org1.orgId!); // // Insert dummy exit nodes // const exitNode1 = db diff --git a/server/emails/templates/SendInviteLink.tsx b/server/emails/templates/SendInviteLink.tsx index 64f19bba..cc05881d 100644 --- a/server/emails/templates/SendInviteLink.tsx +++ b/server/emails/templates/SendInviteLink.tsx @@ -37,7 +37,7 @@ export const SendInviteLink = ({ - You're invite to join a Fossorial organization + You're invited to join a Fossorial organization Hi {email || "there"}, @@ -45,12 +45,15 @@ export const SendInviteLink = ({ You’ve been invited to join the organization{" "} {orgName} - {inviterName ? ` by ${inviterName}.` : ""}. Please + {inviterName ? ` by ${inviterName}.` : "."} Please access the link below to accept the invite. This invite will expire in{" "} - {expiresInDays} days. + + {expiresInDays}{" "} + {expiresInDays === "1" ? "day" : "days"}. +
); }, + cell: ({ row }) => { + const userRow = row.original; + + return ( +
+ {userRow.isOwner && } + {userRow.role} +
+ ); + }, }, { id: "actions", @@ -95,30 +105,39 @@ export default function UsersTable({ users }: UsersTableProps) { return ( <> - - - - - - Manage user - {userRow.email !== user?.email && ( + {!userRow.isOwner && ( + + + + + - + Manage user - )} - - + {userRow.email !== user?.email && ( + + + + )} + + + )} ); }, diff --git a/src/app/[orgId]/settings/users/page.tsx b/src/app/[orgId]/settings/users/page.tsx index a064b3b3..2440ff2f 100644 --- a/src/app/[orgId]/settings/users/page.tsx +++ b/src/app/[orgId]/settings/users/page.tsx @@ -8,6 +8,7 @@ import { cache } from "react"; import OrgProvider from "@app/providers/OrgProvider"; import UserProvider from "@app/providers/UserProvider"; import { verifySession } from "@app/lib/auth/verifySession"; +import CopyTextBox from "@app/components/CopyTextBox"; type UsersPageProps = { params: Promise<{ orgId: string }>; @@ -55,7 +56,8 @@ export default async function UsersPage(props: UsersPageProps) { id: user.id, email: user.email, status: "Confirmed", - role: user.roleName || "", + role: user.isOwner ? "Owner" : user.roleName || "Member", + isOwner: user.isOwner || false, }; });