From a8caeb3947fea669df55d3f64a83abec896ff998 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Tue, 24 Sep 2024 22:31:02 +0800 Subject: [PATCH] Update remove member modal (#29410) * Update remove member modal * Add same warning for leaving an org * Update modal * Update warning * Grammar and spacing edits --------- Co-authored-by: Terry Sutton --- .../TeamSettings/MemberActions.tsx | 34 +++++++++++++++++-- .../TeamSettings/TeamSettings.tsx | 26 +++++++++++--- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/MemberActions.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/MemberActions.tsx index b4094c18936..2453cddf761 100644 --- a/apps/studio/components/interfaces/Organization/TeamSettings/MemberActions.tsx +++ b/apps/studio/components/interfaces/Organization/TeamSettings/MemberActions.tsx @@ -232,7 +232,7 @@ export const MemberActions = ({ member }: MemberActionsProps) => { icon={} /> - + <> {isPendingInviteAcceptance ? ( <> @@ -281,17 +281,45 @@ export const MemberActions = ({ member }: MemberActionsProps) => { + Removing a member will delete all of the user's saved content in all projects of this + organization, which includes: +
    +
  • + SQL snippets{' '} + + (both private and{' '} + shared snippets) + +
  • +
  • Custom reports
  • +
  • Log Explorer queries
  • +
+

+ If you'd like to retain the member's shared SQL snippets, right click on them and + "Duplicate personal copy" in the SQL Editor before removing this member. +

+ + ), + }} onCancel={() => setIsDeleteModalOpen(false)} onConfirm={() => { handleMemberDelete() }} >

- This is permanent! Are you sure you want to remove {member.primary_email} + Are you sure you want to remove{' '} + {member.primary_email} from{' '} + {selectedOrganization?.name}?

diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx index 7779fdf6cf5..c33d8ca7c17 100644 --- a/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx +++ b/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx @@ -122,13 +122,31 @@ const TeamSettings = () => { setIsLeaveTeamModalOpen(false)} - onConfirm={() => { - leaveTeam() + variant="warning" + alert={{ + title: 'All of your user content will be permanently removed.', + description: ( +
+

+ Leaving the organization will delete all of your saved content in the projects of + the organization, which includes: +

+
    +
  • + SQL snippets (both private and shared) +
  • +
  • Custom reports
  • +
  • Log Explorer queries
  • +
+
+ ), }} + onCancel={() => setIsLeaveTeamModalOpen(false)} + onConfirm={() => leaveTeam()} >

Are you sure you want to leave this organization? This is permanent.