2019-09-09 09:31:08 +02:00
|
|
|
|
<template>
|
2020-03-12 14:29:21 +01:00
|
|
|
|
<section>
|
2019-09-09 09:31:08 +02:00
|
|
|
|
<ul v-if="actionLogs.length > 0">
|
|
|
|
|
<li v-for="log in actionLogs">
|
|
|
|
|
<div class="box">
|
2019-12-20 13:04:34 +01:00
|
|
|
|
<img class="image" :src="log.actor.avatar.url" v-if="log.actor.avatar" />
|
2019-09-09 09:31:08 +02:00
|
|
|
|
<span>@{{ log.actor.preferredUsername }}</span>
|
|
|
|
|
<span v-if="log.action === ActionLogAction.REPORT_UPDATE_CLOSED">
|
2019-10-03 12:32:20 +02:00
|
|
|
|
closed <router-link :to="{ name: RouteName.REPORT, params: { reportId: log.object.id } }">report #{{ log.object.id }}</router-link>
|
2019-09-09 09:31:08 +02:00
|
|
|
|
</span>
|
|
|
|
|
<span v-else-if="log.action === ActionLogAction.REPORT_UPDATE_OPENED">
|
2019-10-03 12:32:20 +02:00
|
|
|
|
reopened <router-link :to="{ name: RouteName.REPORT, params: { reportId: log.object.id } }">report #{{ log.object.id }}</router-link>
|
2019-09-09 09:31:08 +02:00
|
|
|
|
</span>
|
|
|
|
|
<span v-else-if="log.action === ActionLogAction.REPORT_UPDATE_RESOLVED">
|
2019-10-03 12:32:20 +02:00
|
|
|
|
marked <router-link :to="{ name: RouteName.REPORT, params: { reportId: log.object.id } }">report #{{ log.object.id }}</router-link> as resolved
|
2019-09-09 09:31:08 +02:00
|
|
|
|
</span>
|
|
|
|
|
<span v-else-if="log.action === ActionLogAction.NOTE_CREATION">
|
|
|
|
|
added a note on
|
2019-10-03 12:32:20 +02:00
|
|
|
|
<router-link v-if="log.object.report" :to="{ name: RouteName.REPORT, params: { reportId: log.object.report.id } }">report #{{ log.object.report.id }}</router-link>
|
2019-09-09 09:31:08 +02:00
|
|
|
|
<span v-else>a non-existent report</span>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-else-if="log.action === ActionLogAction.EVENT_DELETION">
|
|
|
|
|
deleted an event named « {{ log.object.title }} »
|
|
|
|
|
</span>
|
|
|
|
|
<br />
|
|
|
|
|
<small>{{ log.insertedAt | formatDateTimeString }}</small>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <pre>{{ log }}</pre>-->
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<b-message type="is-info">No moderation logs yet</b-message>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
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';
|
2019-10-03 12:32:20 +02:00
|
|
|
|
import { RouteName } from '@/router';
|
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;
|
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>
|
2019-09-09 09:31:08 +02:00
|
|
|
|
img.image {
|
|
|
|
|
display: inline;
|
|
|
|
|
height: 1.5em;
|
|
|
|
|
vertical-align: text-bottom;
|
|
|
|
|
}
|
|
|
|
|
</style>
|