Provide options to delete media and redact events on user erase (#49)

* Provide options to delete media and redact events on user erase

* update readme
This commit is contained in:
Aine
2024-09-29 00:16:44 +03:00
committed by GitHub
parent f8fe1166e2
commit f3080e9468
12 changed files with 205 additions and 16 deletions

View File

@@ -36,7 +36,6 @@ import {
ResourceProps,
SearchInput,
SelectInput,
BulkDeleteButton,
DeleteButton,
maxLength,
regex,
@@ -61,6 +60,7 @@ import {
import { Link } from "react-router-dom";
import AvatarField from "../components/AvatarField";
import DeleteUserButton from "../components/DeleteUserButton";
import { isASManaged } from "../components/mxid";
import { ServerNoticeButton, ServerNoticeBulkButton } from "../components/ServerNotices";
import { DATE_FORMAT } from "../components/date";
@@ -141,10 +141,10 @@ const UserBulkActionButtons = () => {
<>
<ServerNoticeBulkButton />
<UserPreventSelfDelete ownUserIsSelected={ownUserIsSelected} asManagedUserIsSelected={asManagedUserIsSelected}>
<BulkDeleteButton
label="resources.users.action.erase"
<DeleteUserButton
selectedIds={selectedIds}
confirmTitle="resources.users.helper.erase"
mutationMode="pessimistic"
confirmContent="resources.users.helper.erase_text"
/>
</UserPreventSelfDelete>
</>
@@ -200,15 +200,15 @@ const UserEditActions = () => {
return (
<TopToolbar>
{!record?.deactivated && <ServerNoticeButton />}
{record && record.id && (
<UserPreventSelfDelete ownUserIsSelected={ownUserIsSelected} asManagedUserIsSelected={asManagedUserIsSelected}>
<DeleteButton
label="resources.users.action.erase"
confirmTitle={translate("resources.users.helper.erase", {
smart_count: 1,
})}
mutationMode="pessimistic"
<DeleteUserButton
selectedIds={[record?.id]}
confirmTitle="resources.users.helper.erase"
confirmContent="resources.users.helper.erase_text"
/>
</UserPreventSelfDelete>
)}
</TopToolbar>
);
};