2019-09-09 09:31:08 +02:00
|
|
|
<template>
|
2020-02-18 08:57:00 +01:00
|
|
|
<section>
|
|
|
|
<ul v-if="actionLogs.length > 0">
|
2020-06-09 14:55:48 +02:00
|
|
|
<li v-for="log in actionLogs" :key="log.id">
|
2020-02-18 08:57:00 +01:00
|
|
|
<div class="box">
|
|
|
|
<img class="image" :src="log.actor.avatar.url" v-if="log.actor.avatar" />
|
2020-06-09 14:55:48 +02:00
|
|
|
<i18n
|
|
|
|
v-if="log.action === ActionLogAction.REPORT_UPDATE_CLOSED"
|
|
|
|
tag="span"
|
|
|
|
path="{actor} closed {report}"
|
|
|
|
>
|
|
|
|
<span slot="actor">@{{ log.actor.preferredUsername }}</span>
|
|
|
|
<router-link
|
|
|
|
:to="{ name: RouteName.REPORT, params: { reportId: log.object.id } }"
|
|
|
|
slot="report"
|
|
|
|
>{{ $t("report #{report_number}", { report_number: log.object.id }) }}
|
|
|
|
</router-link>
|
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.REPORT_UPDATE_OPENED"
|
|
|
|
tag="span"
|
|
|
|
path="{actor} reopened {report}"
|
|
|
|
>
|
|
|
|
<span slot="actor">@{{ log.actor.preferredUsername }}</span>
|
|
|
|
<router-link
|
|
|
|
:to="{ name: RouteName.REPORT, params: { reportId: log.object.id } }"
|
|
|
|
slot="report"
|
|
|
|
>{{ $t("report #{report_number}", { report_number: log.object.id }) }}
|
|
|
|
</router-link>
|
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.REPORT_UPDATE_RESOLVED"
|
|
|
|
tag="span"
|
|
|
|
path="{actor} marked {report} as resolved"
|
|
|
|
>
|
|
|
|
<span slot="actor">@{{ log.actor.preferredUsername }}</span>
|
|
|
|
<router-link
|
|
|
|
:to="{ name: RouteName.REPORT, params: { reportId: log.object.id } }"
|
|
|
|
slot="report"
|
|
|
|
>{{ $t("report #{report_number}", { report_number: log.object.id }) }}
|
|
|
|
</router-link>
|
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.NOTE_CREATION"
|
|
|
|
tag="span"
|
|
|
|
path="{actor} added a note on {report}"
|
|
|
|
>
|
|
|
|
<span slot="actor">@{{ log.actor.preferredUsername }}</span>
|
2020-02-18 08:57:00 +01:00
|
|
|
<router-link
|
|
|
|
v-if="log.object.report"
|
|
|
|
:to="{ name: RouteName.REPORT, params: { reportId: log.object.report.id } }"
|
2020-06-09 14:55:48 +02:00
|
|
|
slot="report"
|
|
|
|
>{{ $t("report #{report_number}", { report_number: log.object.report.id }) }}
|
|
|
|
</router-link>
|
|
|
|
<span v-else slot="report">{{ $t("a non-existent report") }}</span>
|
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.EVENT_DELETION"
|
|
|
|
tag="span"
|
|
|
|
path='{actor} deleted an event named "{title}"'
|
2020-02-18 08:57:00 +01:00
|
|
|
>
|
2020-06-09 14:55:48 +02:00
|
|
|
<span slot="actor">@{{ log.actor.preferredUsername }}</span>
|
|
|
|
<span slot="title">{{ log.object.title }}</span>
|
|
|
|
</i18n>
|
2020-02-18 08:57:00 +01:00
|
|
|
<br />
|
|
|
|
<small>{{ log.insertedAt | formatDateTimeString }}</small>
|
2019-09-09 09:31:08 +02:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div v-else>
|
2020-06-09 14:55:48 +02:00
|
|
|
<b-message type="is-info">{{ $t("No moderation logs yet") }}</b-message>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
|
|
|
</section>
|
2019-09-09 09:31:08 +02:00
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Vue } from "vue-property-decorator";
|
|
|
|
import { IActionLog, ActionLogAction } from "@/types/report.model";
|
|
|
|
import { LOGS } from "@/graphql/report";
|
|
|
|
import ReportCard from "@/components/Report/ReportCard.vue";
|
|
|
|
import RouteName from "../../router/name";
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
ReportCard,
|
|
|
|
},
|
|
|
|
apollo: {
|
|
|
|
actionLogs: {
|
|
|
|
query: LOGS,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
export default class ReportList extends Vue {
|
|
|
|
actionLogs?: IActionLog[] = [];
|
|
|
|
|
|
|
|
ActionLogAction = ActionLogAction;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-10-03 12:32:20 +02:00
|
|
|
RouteName = RouteName;
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
|
|
|
</script>
|
2019-12-03 11:29:51 +01:00
|
|
|
<style lang="scss" scoped>
|
2020-02-18 08:57:00 +01:00
|
|
|
img.image {
|
2020-06-09 14:55:48 +02:00
|
|
|
display: inline-block;
|
2020-02-18 08:57:00 +01:00
|
|
|
height: 1.5em;
|
|
|
|
vertical-align: text-bottom;
|
|
|
|
}
|
|
|
|
</style>
|