refactor: Rename "suspend" into "ban" for account deletion
This commit is contained in:
@@ -84,7 +84,7 @@
|
||||
role="alert"
|
||||
>
|
||||
<i18n-t
|
||||
keypath="This profile is located on this instance, so you need to {access_the_corresponding_account} to suspend it."
|
||||
keypath="This profile is located on this instance, so you need to {access_the_corresponding_account} to ban it."
|
||||
>
|
||||
<template #access_the_corresponding_account>
|
||||
<router-link
|
||||
|
||||
@@ -184,8 +184,8 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="buttons" v-if="!user.disabled">
|
||||
<o-button @click="suspendAccount" variant="danger">{{
|
||||
t("Suspend")
|
||||
<o-button @click="deleteAccount" variant="danger">{{
|
||||
t("Ban")
|
||||
}}</o-button>
|
||||
</div>
|
||||
<div
|
||||
@@ -193,7 +193,7 @@
|
||||
class="p-4 mb-4 text-sm text-red-700 bg-red-100 rounded-lg"
|
||||
role="alert"
|
||||
>
|
||||
{{ t("The user has been disabled") }}
|
||||
{{ t("The user has been banned") }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -339,7 +339,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { formatBytes } from "@/utils/datetime";
|
||||
import { ICurrentUserRole } from "@/types/enums";
|
||||
import { GET_USER, SUSPEND_USER } from "../../graphql/user";
|
||||
import { GET_USER, DELETE_ACCOUNT_AS_MODERATOR } from "../../graphql/user";
|
||||
import RouteName from "../../router/name";
|
||||
import { IUser } from "../../types/current-user.model";
|
||||
import EmptyContent from "../../components/Utils/EmptyContent.vue";
|
||||
@@ -479,24 +479,24 @@ const roleName = (role: ICurrentUserRole): string => {
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const { mutate: suspendUser } = useMutation<
|
||||
{ suspendProfile: { id: string } },
|
||||
const { mutate: deleteUserAccount } = useMutation<
|
||||
{ deleteProfile: { id: string } },
|
||||
{ userId: string }
|
||||
>(SUSPEND_USER);
|
||||
>(DELETE_ACCOUNT_AS_MODERATOR);
|
||||
|
||||
const dialog = inject<Dialog>("dialog");
|
||||
|
||||
const suspendAccount = async (): Promise<void> => {
|
||||
const deleteAccount = async (): Promise<void> => {
|
||||
dialog?.confirm({
|
||||
title: t("Suspend the account?"),
|
||||
title: t("Ban the account?"),
|
||||
message: t(
|
||||
"Do you really want to suspend this account? All of the user's profiles will be deleted."
|
||||
"Do you really want to ban this account? All of the user's profiles will be deleted."
|
||||
),
|
||||
confirmText: t("Suspend the account"),
|
||||
confirmText: t("Ban the account"),
|
||||
cancelText: t("Cancel"),
|
||||
variant: "danger",
|
||||
onConfirm: async () => {
|
||||
suspendUser({
|
||||
deleteUserAccount({
|
||||
userId: props.id,
|
||||
});
|
||||
return router.push({ name: RouteName.USERS });
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
@click="suspendUser((report.reported as IPerson).user as IUser)"
|
||||
icon-left="delete"
|
||||
size="small"
|
||||
>{{ t("Suspend the account") }}</o-button
|
||||
>{{ t("Ban the account") }}</o-button
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -429,7 +429,7 @@ import EmptyContent from "@/components/Utils/EmptyContent.vue";
|
||||
import EventComment from "@/components/Comment/EventComment.vue";
|
||||
import DiscussionComment from "@/components/Discussion/DiscussionComment.vue";
|
||||
import { SUSPEND_PROFILE } from "@/graphql/actor";
|
||||
import { GET_USER, SUSPEND_USER } from "@/graphql/user";
|
||||
import { GET_USER, DELETE_ACCOUNT_AS_MODERATOR } from "@/graphql/user";
|
||||
import { IUser } from "@/types/current-user.model";
|
||||
|
||||
const router = useRouter();
|
||||
@@ -757,7 +757,7 @@ const { mutate: doSuspendProfile, onDone: onSuspendProfileDone } = useMutation<
|
||||
const { mutate: doSuspendUser, onDone: onSuspendUserDone } = useMutation<
|
||||
{ suspendProfile: { id: string } },
|
||||
{ userId: string }
|
||||
>(SUSPEND_USER);
|
||||
>(DELETE_ACCOUNT_AS_MODERATOR);
|
||||
|
||||
const { load: loadUserLazyQuery } = useLazyQuery<
|
||||
{ user: IUser },
|
||||
@@ -812,9 +812,9 @@ const suspendUser = async (user: IUser): Promise<void> => {
|
||||
}
|
||||
|
||||
dialog?.confirm({
|
||||
title: t("Suspend the account?"),
|
||||
title: t("Ban the account?"),
|
||||
message:
|
||||
t("Do you really want to suspend the account « {emailAccount} » ?", {
|
||||
t("Do you really want to ban the account « {emailAccount} » ?", {
|
||||
emailAccount: cachedReportedUser.value.email,
|
||||
}) +
|
||||
" " +
|
||||
@@ -822,7 +822,7 @@ const suspendUser = async (user: IUser): Promise<void> => {
|
||||
"<b>" +
|
||||
t("There will be no way to restore the user's data!") +
|
||||
`</b>`,
|
||||
confirmText: t("Suspend the account"),
|
||||
confirmText: t("Ban the account"),
|
||||
cancelText: t("Cancel"),
|
||||
variant: "danger",
|
||||
onConfirm: async () => {
|
||||
|
||||
@@ -243,7 +243,7 @@ import { useRouter } from "vue-router";
|
||||
import {
|
||||
CHANGE_EMAIL,
|
||||
CHANGE_PASSWORD,
|
||||
DELETE_ACCOUNT,
|
||||
DELETE_ACCOUNT_AS_USER,
|
||||
} from "../../graphql/user";
|
||||
import RouteName from "../../router/name";
|
||||
import { logout, SELECTED_PROVIDERS } from "../../utils/auth";
|
||||
@@ -342,7 +342,7 @@ const {
|
||||
onDone: deleteAccountMutationDone,
|
||||
onError: deleteAccountMutationError,
|
||||
} = useMutation<{ deleteAccount: { id: string } }, { password?: string }>(
|
||||
DELETE_ACCOUNT
|
||||
DELETE_ACCOUNT_AS_USER
|
||||
);
|
||||
|
||||
const { notification } = useOruga();
|
||||
|
||||
Reference in New Issue
Block a user