Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion app/components/AclMembersPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ export function AclMembersPanel({ mailboxId }: AclMembersPanelProps) {
variant="secondary"
size="sm"
loading={lockDown.isPending}
onClick={() => lockDown.mutate(mailboxId)}
onClick={() => {
if (
window.confirm(
"Are you sure you want to lock down this mailbox? Only you will have access until you add others.",
)
) {
lockDown.mutate(mailboxId);
}
}}
data-testid="acl-lockdown-btn"
>
Lock down
Expand Down Expand Up @@ -89,6 +97,7 @@ export function AclMembersPanel({ mailboxId }: AclMembersPanelProps) {
};

const handleRemove = async (email: string) => {
if (!window.confirm(`Are you sure you want to remove ${email}?`)) return;
setRemoveError(null);
try {
await removeMember.mutateAsync(email);
Expand All @@ -100,6 +109,12 @@ export function AclMembersPanel({ mailboxId }: AclMembersPanelProps) {
};

const handleTransfer = async (email: string) => {
if (
!window.confirm(
`Are you sure you want to transfer ownership to ${email}? You will lose owner privileges.`,
)
)
return;
setTransferError(null);
try {
await transferOwnership.mutateAsync(email);
Expand All @@ -125,6 +140,8 @@ export function AclMembersPanel({ mailboxId }: AclMembersPanelProps) {
};

const handleRemoveGroup = async (group: string) => {
if (!window.confirm(`Are you sure you want to remove group ${group}?`))
return;
setRemoveGroupError(null);
try {
await removeGroup.mutateAsync(group);
Expand Down
Loading