- {{ $t('reports.moderateUser') }}
+
+ {{ $t('reports.moderateUser') }}
@@ -47,6 +48,10 @@ export default {
reportId: {
type: String,
required: true
+ },
+ renderedFrom: {
+ type: String,
+ required: true
}
},
computed: {
@@ -96,9 +101,15 @@ export default {
})
},
handleDeactivation(user) {
- user.deactivated
- ? this.$store.dispatch('ActivateUserFromReports', { user, reportId: this.reportId })
- : this.$store.dispatch('DeactivateUserFromReports', { user, reportId: this.reportId })
+ if (this.renderedFrom === 'showPage') {
+ user.deactivated
+ ? this.$store.dispatch('ActivateUserFromReportShow', user)
+ : this.$store.dispatch('DeactivateUserFromReportShow', user)
+ } else if (this.renderedFrom === 'reportsPage') {
+ user.deactivated
+ ? this.$store.dispatch('ActivateUserFromReports', { user, reportId: this.reportId })
+ : this.$store.dispatch('DeactivateUserFromReports', { user, reportId: this.reportId })
+ }
},
handleDeletion(user) {
this.$confirm(
@@ -120,9 +131,15 @@ export default {
return this.$store.state.user.id !== id
},
toggleTag(user, tag) {
- user.tags.includes(tag)
- ? this.$store.dispatch('RemoveTagFromReports', { user, tag, reportId: this.reportId })
- : this.$store.dispatch('AddTagFromReports', { user, tag, reportId: this.reportId })
+ if (this.renderedFrom === 'showPage') {
+ user.tags.includes(tag)
+ ? this.$store.dispatch('RemoveTagFromReportsFromReportShow', { user, tag })
+ : this.$store.dispatch('AddTagFromReportsFromReportShow', { user, tag })
+ } else if (this.renderedFrom === 'reportsPage') {
+ user.tags.includes(tag)
+ ? this.$store.dispatch('RemoveTagFromReports', { user, tag, reportId: this.reportId })
+ : this.$store.dispatch('AddTagFromReports', { user, tag, reportId: this.reportId })
+ }
}
}
}
diff --git a/src/views/reports/components/Report.vue b/src/views/reports/components/Report.vue
index 81847635..423aa439 100644
--- a/src/views/reports/components/Report.vue
+++ b/src/views/reports/components/Report.vue
@@ -24,7 +24,11 @@
{{ $t('reports.close') }}
-
+
@@ -74,12 +78,12 @@ export default {
}
},
methods: {
- changeReportState(state, id) {
- this.$store.dispatch('ChangeReportState', [{ state, id }])
- },
capitalizeFirstLetter(str) {
return str.charAt(0).toUpperCase() + str.slice(1)
},
+ changeReportState(state, id) {
+ this.$store.dispatch('ChangeReportState', [{ state, id }])
+ },
getStateType(state) {
switch (state) {
case 'closed':
diff --git a/src/views/reports/show.vue b/src/views/reports/show.vue
index 35468fbb..5f30f376 100644
--- a/src/views/reports/show.vue
+++ b/src/views/reports/show.vue
@@ -12,7 +12,23 @@
{{ $t('reports.report') }}
-
+
+ {{ capitalizeFirstLetter(report.state) }}
+
+ {{ $t('reports.changeState') }}
+
+ {{ $t('reports.resolve') }}
+ {{ $t('reports.reopen') }}
+ {{ $t('reports.close') }}
+
+
+
+
+
{{ $t('reports.id') }}: {{ report.id }}
@@ -22,12 +38,13 @@