Skip to content
Snippets Groups Projects
Commit 2c6f699a authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Add router link to user's profile to log entry message

parent f96d4956
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
v-if="propertyExists(actor, 'id')"
:to="{ name: 'UsersShow', params: { id: actor.id }}"
class="router-link">
<span v-if="propertyExists(actor, 'nickname')">
<span v-if="propertyExists(actor, 'nickname')" style="font-weight: 600">
@{{ actor.nickname }}
</span>
</router-link>
......@@ -24,15 +24,11 @@ export default {
message: {
type: String,
required: true
},
data: {
type: Object,
required: true
}
},
computed: {
logEntryMessage() {
return this.message
return this.message.split(this.actor.nickname)[1]
}
},
methods: {
......
......@@ -43,7 +43,8 @@
v-for="(logEntry, index) in log"
:key="index"
:timestamp="normalizeTimestamp(logEntry.time)">
<log-entry-message :actor="logEntry.data.actor" :data="logEntry.data" :message="logEntry.message"/>
<log-entry-message v-if="propertyExists(logEntry.data.actor, 'nickname')" :actor="logEntry.data.actor" :message="logEntry.message"/>
<span v-else>{{ logEntry.message }}</span>
</el-timeline-item>
</el-timeline>
<div class="pagination">
......@@ -115,9 +116,6 @@ export default {
this.$store.dispatch('FetchAdmins')
},
methods: {
normalizeTimestamp(timestamp) {
return moment(timestamp * 1000).format('YYYY-MM-DD HH:mm')
},
fetchLogWithFilters() {
const filters = _.omitBy({
start_date: this.dateRange ? this.dateRange[0].toISOString() : null,
......@@ -128,6 +126,12 @@ export default {
}, val => val === '' || val === null)
this.$store.dispatch('FetchModerationLog', filters)
},
normalizeTimestamp(timestamp) {
return moment(timestamp * 1000).format('YYYY-MM-DD HH:mm')
},
propertyExists(account, property) {
return account[property]
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment