diff --git a/js/src/components/Report/ReportCard.vue b/js/src/components/Report/ReportCard.vue index fbc29daa3..1f305f30c 100644 --- a/js/src/components/Report/ReportCard.vue +++ b/js/src/components/Report/ReportCard.vue @@ -28,7 +28,7 @@ {{ $t("Reported by {reporter}", { reporter: report.reporter.preferredUsername }) }} -
{{ report.content }}
+
diff --git a/js/src/components/Report/ReportModal.vue b/js/src/components/Report/ReportModal.vue index 26fa34a69..020725eb7 100644 --- a/js/src/components/Report/ReportModal.vue +++ b/js/src/components/Report/ReportModal.vue @@ -100,15 +100,15 @@ export default class ReportModal extends Vue { forward = false; - get translatedCancelText() { - return this.cancelText || this.$t("Cancel"); + get translatedCancelText(): string { + return this.cancelText || (this.$t("Cancel") as string); } - get translatedConfirmText() { - return this.confirmText || this.$t("Send the report"); + get translatedConfirmText(): string { + return this.confirmText || (this.$t("Send the report") as string); } - confirm() { + confirm(): void { this.onConfirm(this.content, this.forward); this.close(); } @@ -116,7 +116,7 @@ export default class ReportModal extends Vue { /** * Close the Dialog. */ - close() { + close(): void { this.isActive = false; this.$emit("close"); } diff --git a/js/src/graphql/report.ts b/js/src/graphql/report.ts index 43784c855..e0cdac446 100644 --- a/js/src/graphql/report.ts +++ b/js/src/graphql/report.ts @@ -114,7 +114,7 @@ export const REPORT = gql` export const CREATE_REPORT = gql` mutation CreateReport( - $eventId: ID! + $eventId: ID $reporterId: ID! $reportedId: ID! $content: String diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index ff959e12e..a379b32ee 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -773,5 +773,11 @@ "Will allow to display and manage your participation status on the event page when using this device. Uncheck if you're using a public device.": "Will allow to display and manage your participation status on the event page when using this device. Uncheck if you're using a public device.", "Visit event page": "Visit event page", "Remember my participation in this browser": "Remember my participation in this browser", - "Organized by": "Organized by" + "Organized by": "Organized by", + "Report this group": "Report this group", + "Group {groupTitle} reported": "Group {groupTitle} reported", + "Error while reporting group {groupTitle}": "Error while reporting group {groupTitle}", + "Reported group": "Reported group", + "You can only get invited to groups right now.": "You can only get invited to groups right now.", + "Join group": "Join group" } diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 03ea86886..3cd54e786 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -810,5 +810,11 @@ "Will allow to display and manage your participation status on the event page when using this device. Uncheck if you're using a public device.": "Permet d'afficher et de gérer le statut de votre participation sur la page de l'événement lorsque vous utilisez cet appareil. Décochez si vous utilisez un appareil public.", "Visit event page": "Voir la page de l'événement", "Remember my participation in this browser": "Se souvenir de ma participation dans ce navigateur", - "Organized by": "Organisé par" + "Organized by": "Organisé par", + "Report this group": "Signaler ce groupe", + "Group {groupTitle} reported": "Groupe {groupTitle} signalé", + "Error while reporting group {groupTitle}": "Erreur lors du signalement du groupe {groupTitle}", + "Reported group": "Groupe signalé", + "You can only get invited to groups right now.": "Vous pouvez uniquement être invité aux groupes pour le moment.", + "Join group": "Rejoindre le groupe" } diff --git a/js/src/views/Event/Event.vue b/js/src/views/Event/Event.vue index 03a442144..84e6ae388 100644 --- a/js/src/views/Event/Event.vue +++ b/js/src/views/Event/Event.vue @@ -413,7 +413,7 @@ @@ -521,7 +521,7 @@ import { ParticipantRole, EventJoinOptions, } from "../../types/event.model"; -import { IPerson, Person, usernameWithDomain } from "../../types/actor"; +import { IActor, IPerson, Person, usernameWithDomain } from "../../types/actor"; import { GRAPHQL_API_ENDPOINT } from "../../api/_entrypoint"; import DateCalendarIcon from "../../components/Event/DateCalendarIcon.vue"; import EventCard from "../../components/Event/EventCard.vue"; @@ -786,7 +786,7 @@ export default class Event extends EventMixin { variables: { eventId: this.event.id, reporterId, - reportedId: this.event.organizerActor.id, + reportedId: this.actorForReport ? this.actorForReport.id : null, content, forward, }, @@ -1026,6 +1026,23 @@ export default class Event extends EventMixin { this.config && (this.currentActor.id !== undefined || this.config.anonymous.reports.allowed) ); } + + get actorForReport(): IActor | null { + if (this.event.attributedTo && this.event.attributedTo.id) { + return this.event.attributedTo; + } + if (this.event.organizerActor) { + return this.event.organizerActor; + } + return null; + } + + get domainForReport(): string | null { + if (this.actorForReport) { + return this.actorForReport.domain; + } + return null; + } }