Sync user archive across all interfaces

Align user-removal UX and API surface semantics with the new archive\nbehavior for manually managed users.\n\nFrontend copy and actions now use archive wording, and list rows are\nrefetched after the mutation so archived users reappear as inactive.\n\nMCP removeUser now documents and returns archived_user_id, n8n labels\nand response mapping now use archive semantics, and the CLI gains a\nuser archive command backed by the same mutation.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
Cursor Agent
2026-05-27 00:50:28 +00:00
committed by Bryan Frimin
parent ebe9cc0e65
commit 23070b18b5
9 changed files with 152 additions and 31 deletions

View File

@@ -67,8 +67,8 @@ export function PersonPage(props: { queryRef: PreloadedQuery<PersonPageQuery> })
const [removeUser, isRemoving] = useMutationWithToasts(
removeUserMutation,
{
successMessage: __("Person removed successfully"),
errorMessage: __("Failed to remove person"),
successMessage: __("Person archived successfully"),
errorMessage: __("Failed to archive person"),
},
);
@@ -89,13 +89,15 @@ export function PersonPage(props: { queryRef: PreloadedQuery<PersonPageQuery> })
},
{
message: sprintf(
__("Are you sure you want to remove %s?"),
__("Are you sure you want to archive %s?"),
person.fullName,
),
},
);
};
const canArchive = person.canDelete && person.source !== "SCIM";
return (
<div className="space-y-6">
<Breadcrumb
@@ -120,7 +122,7 @@ export function PersonPage(props: { queryRef: PreloadedQuery<PersonPageQuery> })
<div className="text-lg text-txt-secondary">{person.emailAddress}</div>
</div>
</div>
{person.canDelete && person.source !== "SCIM" && (
{canArchive && (
<ActionDropdown variant="secondary">
<DropdownItem
variant="danger"
@@ -128,7 +130,7 @@ export function PersonPage(props: { queryRef: PreloadedQuery<PersonPageQuery> })
onClick={handleRemove}
disabled={isRemoving}
>
{__("Delete")}
{__("Archive")}
</DropdownItem>
</ActionDropdown>
)}

View File

@@ -112,7 +112,7 @@ export function PeopleListItem(props: {
fKey: PeopleListItemFragment$key;
onRefetch: () => void;
}) {
const { fKey, connectionId } = props;
const { fKey, connectionId, onRefetch } = props;
const organizationId = useOrganizationId();
const { __ } = useTranslate();
@@ -127,7 +127,7 @@ export function PeopleListItem(props: {
const isInactive = profile.state === "INACTIVE";
const canSendActivationMail = isInactive && profile.source !== "SCIM" && profile.canInvite;
const canDelete = profile.canDelete && profile.source !== "SCIM";
const canArchive = profile.canDelete && profile.source !== "SCIM" && profile.state !== "INACTIVE";
const [inviteUser]
= useMutationWithToasts<PeopleListItem_inviteMutation>(inviteUserMutation, {
@@ -144,8 +144,8 @@ export function PeopleListItem(props: {
const [removeUser, isRemoving] = useMutationWithToasts(
removeUserMutation,
{
successMessage: __("Person removed successfully"),
errorMessage: __("Failed to remove person"),
successMessage: __("Person archived successfully"),
errorMessage: __("Failed to archive person"),
},
);
@@ -194,11 +194,14 @@ export function PeopleListItem(props: {
},
connections: [connectionId],
},
onCompleted: () => {
onRefetch();
},
});
},
{
message: sprintf(
__("Are you sure you want to remove %s?"),
__("Are you sure you want to archive %s?"),
profile.fullName,
),
},
@@ -267,7 +270,7 @@ export function PeopleListItem(props: {
{new Date(profile.createdAt).toLocaleDateString()}
</Td>
<Td noLink width={160} className="text-end">
{(canSendActivationMail || canDelete) && (
{(canSendActivationMail || canArchive) && (
<ActionDropdown>
{canSendActivationMail && (
<DropdownItem
@@ -277,13 +280,13 @@ export function PeopleListItem(props: {
{lastInvitation ? __("Resend activation mail") : __("Send activation mail")}
</DropdownItem>
)}
{canDelete && (
{canArchive && (
<DropdownItem
onClick={handleRemove}
variant="danger"
icon={IconTrashCan}
>
{__("Remove person")}
{__("Archive person")}
</DropdownItem>
)}
</ActionDropdown>