From 1dc20889da1bb3602021c230f84a3c7287db970b Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 28 Apr 2021 11:59:15 +0200 Subject: [PATCH] Fix missing deleted comment moderation logaction Signed-off-by: Thomas Citharel --- js/src/graphql/report.ts | 15 +++++ js/src/i18n/en_US.json | 5 +- js/src/i18n/fr_FR.json | 5 +- js/src/views/Moderation/Logs.vue | 77 +++++++++++++++++++++++ lib/graphql/schema/discussions/comment.ex | 2 +- 5 files changed, 101 insertions(+), 3 deletions(-) diff --git a/js/src/graphql/report.ts b/js/src/graphql/report.ts index 495ec00f..8b0e8ff0 100644 --- a/js/src/graphql/report.ts +++ b/js/src/graphql/report.ts @@ -185,6 +185,21 @@ export const LOGS = gql` id title } + ... on Comment { + id + text + event { + id + title + uuid + } + actor { + id + preferredUsername + domain + name + } + } ... on Person { id preferredUsername diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index e407330b..762301da 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -987,5 +987,8 @@ "Error while loading the preview": "Error while loading the preview", "Instance feeds": "Instance feeds", "{moderator} suspended group {profile}": "{moderator} suspended group {profile}", - "{moderator} has unsuspended group {profile}": "{moderator} has unsuspended group {profile}" + "{moderator} has unsuspended group {profile}": "{moderator} has unsuspended group {profile}", + "{moderator} has done an unknown action": "{moderator} has done an unknown action", + "{moderator} has deleted a comment from {author} under the event {event}": "{moderator} has deleted a comment from {author} under the event {event}", + "{moderator} has deleted a comment from {author}": "{moderator} has deleted a comment from {author}" } diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 65300b43..878eaeb1 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -1081,5 +1081,8 @@ "Error while loading the preview": "Erreur lors du chargement de l'aperçu", "Instance feeds": "Flux de l'instance", "{moderator} suspended group {profile}": "{moderator} a suspendu le groupe {profile}", - "{moderator} has unsuspended group {profile}": "{moderator} a annulé la suspension du groupe {profile}" + "{moderator} has unsuspended group {profile}": "{moderator} a annulé la suspension du groupe {profile}", + "{moderator} has done an unknown action": "{moderator} a effectué une action inconnue", + "{moderator} has deleted a comment from {author} under the event {event}": "{moderator} a supprimé un commentaire de {author} sous l'événement {event}", + "{moderator} has deleted a comment from {author}": "{moderator} a supprimé un commentaire de {author}" } diff --git a/js/src/views/Moderation/Logs.vue b/js/src/views/Moderation/Logs.vue index a515257e..fb07b124 100644 --- a/js/src/views/Moderation/Logs.vue +++ b/js/src/views/Moderation/Logs.vue @@ -270,6 +270,83 @@ {{ log.object.email }} + + + @{{ log.actor.preferredUsername }} + {{ log.object.event.title }} + + {{ log.object.event.title }} + {{ displayNameAndUsername(log.object.actor) }} + + +
+            
+            
+              
+                @{{ log.actor.preferredUsername }}
+                {{ displayNameAndUsername(log.object.actor) }}
+                
+              
+              
+            
+            
+              @{{ log.actor.preferredUsername }}
+            
             
{{ log.insertedAt | formatDateTimeString }} diff --git a/lib/graphql/schema/discussions/comment.ex b/lib/graphql/schema/discussions/comment.ex index 814739d6..779b8e1d 100644 --- a/lib/graphql/schema/discussions/comment.ex +++ b/lib/graphql/schema/discussions/comment.ex @@ -6,7 +6,7 @@ defmodule Mobilizon.GraphQL.Schema.Discussions.CommentType do import Absinthe.Resolution.Helpers, only: [dataloader: 1] - alias Mobilizon.{Actors, Discussions} + alias Mobilizon.{Actors, Discussions, Events} alias Mobilizon.GraphQL.Resolvers.Comment @desc "A comment"