Fix missing deleted comment moderation logaction

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-04-28 11:59:15 +02:00
parent 65ea6325cd
commit 1dc20889da
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
5 changed files with 101 additions and 3 deletions

View file

@ -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

View file

@ -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}"
}

View file

@ -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}"
}

View file

@ -270,6 +270,83 @@
</router-link>
<b v-else slot="user">{{ log.object.email }}</b>
</i18n>
<span
v-else-if="
log.action === ActionLogAction.COMMENT_DELETION &&
log.object.event
"
>
<i18n
tag="span"
path="{moderator} has deleted a comment from {author} under the event {event}"
>
<router-link
slot="moderator"
:to="{
name: RouteName.ADMIN_PROFILE,
params: { id: log.actor.id },
}"
>@{{ log.actor.preferredUsername }}</router-link
>
<router-link
v-if="log.object.event && log.object.event.uuid"
slot="event"
:to="{
name: RouteName.EVENT,
params: { uuid: log.object.event.uuid },
}"
>{{ log.object.event.title }}
</router-link>
<b v-else slot="event">{{ log.object.event.title }}</b>
<router-link
slot="author"
:to="{
name: RouteName.ADMIN_PROFILE,
params: { id: log.object.actor.id },
}"
>{{ displayNameAndUsername(log.object.actor) }}
</router-link>
</i18n>
<pre v-html="log.object.text" />
</span>
<span v-else-if="log.action === ActionLogAction.COMMENT_DELETION">
<i18n
tag="span"
path="{moderator} has deleted a comment from {author}"
>
<router-link
slot="moderator"
:to="{
name: RouteName.ADMIN_PROFILE,
params: { id: log.actor.id },
}"
>@{{ log.actor.preferredUsername }}</router-link
>
<router-link
slot="author"
:to="{
name: RouteName.ADMIN_PROFILE,
params: { id: log.object.actor.id },
}"
>{{ displayNameAndUsername(log.object.actor) }}
</router-link>
</i18n>
<pre v-html="log.object.text" />
</span>
<i18n
v-else
tag="span"
path="{moderator} has done an unknown action"
>
<router-link
slot="moderator"
:to="{
name: RouteName.ADMIN_PROFILE,
params: { id: log.actor.id },
}"
>@{{ log.actor.preferredUsername }}</router-link
>
</i18n>
<br />
<small>{{ log.insertedAt | formatDateTimeString }}</small>
</div>

View file

@ -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"