The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat: add billing information to the leave org modal (#36868)
Ignacio Dobronich309088be96a0
diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/LeaveTeamButton.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/LeaveTeamButton.tsxindex a1ac7ef9d12..ed13b59e375 100644--- a/apps/studio/components/interfaces/Organization/TeamSettings/LeaveTeamButton.tsx+++ b/apps/studio/components/interfaces/Organization/TeamSettings/LeaveTeamButton.tsx@@ -37,8 +37,13 @@ export const LeaveTeamButton = () => {const { data: members } = useOrganizationMembersQuery({ slug })const { data: allRoles } = useOrganizationRolesV2Query({ slug })- const isOwner = selectedOrganization?.is_ownerconst roles = allRoles?.org_scoped_roles ?? []+ const currentUserMember = members?.find((member) => member.gotrue_id === profile?.gotrue_id)+ const currentUserRoleId = currentUserMember?.role_ids?.[0]+ const currentUserRole = roles.find((role) => role.id === currentUserRoleId)+ const isAdmin = currentUserRole?.name === 'Administrator'+ const isOwner = selectedOrganization?.is_owner+const canLeave = !isOwner || (isOwner && hasMultipleOwners(members, roles))const { mutate: deleteMember } = useOrganizationMemberDeleteMutation({@@ -106,6 +111,22 @@ export const LeaveTeamButton = () => {<li>Custom reports</li><li>Log Explorer queries</li></ul>+ {(isOwner || isAdmin) && (+ <div className="mt-2">+ <p>+ <span className="text-foreground">+ Leaving won't remove your payment method or stop payments.+ </span>+ </p>+ <ul className="list-disc pl-4">+ <li>+ The current payment method will remain active and may still be charged after+ you leave.+ </li>+ <li>The billing address will remain unchanged.</li>+ </ul>+ </div>+ )}</div>),}}