From b9a165a7fc565dc583cca81dd9c54570f73b4ca3 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 31 Aug 2023 18:39:04 +0200 Subject: [PATCH] feat(reports): show suspended status next to reported profile And only show the suspend button if the profile isn't already suspended (or the user disabled) Signed-off-by: Thomas Citharel --- js/src/graphql/report.ts | 3 +++ js/src/i18n/en_US.json | 3 ++- js/src/i18n/fr_FR.json | 3 ++- js/src/views/Moderation/ReportView.vue | 25 ++++++++++++++++++++----- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/js/src/graphql/report.ts b/js/src/graphql/report.ts index eac2e150..9185c7f7 100644 --- a/js/src/graphql/report.ts +++ b/js/src/graphql/report.ts @@ -42,14 +42,17 @@ const REPORT_FRAGMENT = gql` id reported { ...ActorFragment + suspended ... on Person { user { id + disabled } } } reporter { ...ActorFragment + suspended } events { id diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 74cde181..492e68ca 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -1601,5 +1601,6 @@ "Do you really want to suspend the account « {emailAccount} » ?": "Do you really want to suspend the account « {emailAccount} » ?", "There will be no way to restore the user's data!": "There will be no way to restore the user's data!", "User suspended and report resolved": "User suspended and report resolved", - "Profile suspended and report resolved": "Profile suspended and report resolved" + "Profile suspended and report resolved": "Profile suspended and report resolved", + "{profileName} (suspended)": "{profileName} (suspended)" } \ No newline at end of file diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 281bd276..2de32e18 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -1599,5 +1599,6 @@ "Do you really want to suspend the account « {emailAccount} » ?": "Voulez-vous vraiment suspendre le compte « {emailAccount} » ?", "There will be no way to restore the user's data!": "Il n'y aura aucun moyen de restorer les données de l'utilisateur·ice !", "User suspended and report resolved": "Utilisateur suspendu et signalement résolu", - "Profile suspended and report resolved": "Profil suspendu et signalement résolu" + "Profile suspended and report resolved": "Profil suspendu et signalement résolu", + "{profileName} (suspended)": "{profileName} (suspendu·e)" } diff --git a/js/src/views/Moderation/ReportView.vue b/js/src/views/Moderation/ReportView.vue index 9d4c0111..8b7b69f7 100644 --- a/js/src/views/Moderation/ReportView.vue +++ b/js/src/views/Moderation/ReportView.vue @@ -94,27 +94,42 @@ name: RouteName.ADMIN_PROFILE, params: { id: report.reported.id }, }" + class="inline-flex gap-1" > - {{ displayNameAndUsername(report.reported) }} + + {{ t("Suspend the profile") }} {{ t("Suspend the account") }} @@ -133,7 +148,7 @@ >