diff --git a/js/fragmentTypes.json b/js/fragmentTypes.json index daad1c6b3..649592581 100644 --- a/js/fragmentTypes.json +++ b/js/fragmentTypes.json @@ -5,17 +5,50 @@ "kind": "INTERFACE", "name": "ActionLogObject", "possibleTypes": [ + { + "name": "Comment" + }, { "name": "Event" }, { - "name": "Comment" + "name": "Person" }, { "name": "Report" }, { "name": "ReportNote" + }, + { + "name": "User" + } + ] + }, + { + "kind": "INTERFACE", + "name": "ActivityObject", + "possibleTypes": [ + { + "name": "Comment" + }, + { + "name": "Discussion" + }, + { + "name": "Event" + }, + { + "name": "Group" + }, + { + "name": "Member" + }, + { + "name": "Post" + }, + { + "name": "Resource" } ] }, @@ -33,6 +66,18 @@ "name": "Application" } ] + }, + { + "kind": "INTERFACE", + "name": "Interactable", + "possibleTypes": [ + { + "name": "Event" + }, + { + "name": "Group" + } + ] } ] } diff --git a/js/src/apollo/utils.ts b/js/src/apollo/utils.ts index c94e5bd08..92cdcd585 100644 --- a/js/src/apollo/utils.ts +++ b/js/src/apollo/utils.ts @@ -6,28 +6,10 @@ import { AUTH_ACCESS_TOKEN, AUTH_REFRESH_TOKEN } from "@/constants"; import { REFRESH_TOKEN } from "@/graphql/auth"; import { saveTokenData } from "@/utils/auth"; import { ApolloClient } from "apollo-client"; +import introspectionQueryResultData from "../../fragmentTypes.json"; export const fragmentMatcher = new IntrospectionFragmentMatcher({ - introspectionQueryResultData: { - __schema: { - types: [ - { - kind: "UNION", - name: "SearchResult", - possibleTypes: [ - { name: "Event" }, - { name: "Person" }, - { name: "Group" }, - ], - }, - { - kind: "INTERFACE", - name: "Actor", - possibleTypes: [{ name: "Person" }, { name: "Group" }], - }, - ], - }, - }, + introspectionQueryResultData, }); export async function refreshAccessToken( diff --git a/js/src/graphql/report.ts b/js/src/graphql/report.ts index 6ab8ebfcf..495ec00fb 100644 --- a/js/src/graphql/report.ts +++ b/js/src/graphql/report.ts @@ -158,45 +158,54 @@ export const CREATE_REPORT_NOTE = gql` `; export const LOGS = gql` - query { - actionLogs { - id - action - actor { + query ActionLogs($page: Int, $limit: Int) { + actionLogs(page: $page, limit: $limit) { + elements { id - preferredUsername - domain - avatar { - id - url - } - } - object { - ... on Report { - id - } - ... on ReportNote { - report { - id - } - } - ... on Event { - id - title - } - ... on Person { + action + actor { id preferredUsername domain - name + avatar { + id + url + } } - ... on User { - id - email - confirmedAt + object { + ... on Report { + id + } + ... on ReportNote { + report { + id + } + } + ... on Event { + id + title + } + ... on Person { + id + preferredUsername + domain + name + } + ... on Group { + id + preferredUsername + domain + name + } + ... on User { + id + email + confirmedAt + } } + insertedAt } - insertedAt + total } } `; diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index cffa26a7d..e407330b7 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -985,5 +985,7 @@ "Unable to update the profile. The avatar picture may be too heavy.": "Unable to update the profile. The avatar picture may be too heavy.", "Unable to create the profile. The avatar picture may be too heavy.": "Unable to create the profile. The avatar picture may be too heavy.", "Error while loading the preview": "Error while loading the preview", - "Instance feeds": "Instance feeds" + "Instance feeds": "Instance feeds", + "{moderator} suspended group {profile}": "{moderator} suspended group {profile}", + "{moderator} has unsuspended group {profile}": "{moderator} has unsuspended group {profile}" } diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 1866b0f3a..65300b43a 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -1079,5 +1079,7 @@ "Unable to update the profile. The avatar picture may be too heavy.": "Impossible de mettre à jour le profil. L'image d'avatar est probablement trop lourde.", "Unable to create the profile. The avatar picture may be too heavy.": "Impossible de créer le profil. L'image d'avatar est probablement trop lourde.", "Error while loading the preview": "Erreur lors du chargement de l'aperçu", - "Instance feeds": "Flux de l'instance" + "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}" } diff --git a/js/src/views/Moderation/Logs.vue b/js/src/views/Moderation/Logs.vue index fde4b4ffc..a515257e0 100644 --- a/js/src/views/Moderation/Logs.vue +++ b/js/src/views/Moderation/Logs.vue @@ -14,9 +14,9 @@ -
-