From 4dd550a0cf69f3cffdebffb52c52809681088429 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sat, 28 Sep 2019 23:50:57 +0300 Subject: [PATCH] Add tag with report state and ability to change it to Report Card --- src/lang/en.js | 3 +- .../reports/components/GroupedReport.vue | 12 +++++- src/views/reports/components/ReportCard.vue | 41 +++++++++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/src/lang/en.js b/src/lang/en.js index 276f6a45..41d7f54a 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -262,7 +262,8 @@ export default { deleteCompleted: 'Delete comleted', deleteCanceled: 'Delete canceled', noNotes: 'No notes to display', - changeState: 'Change report state', + changeState: "Change report's state", + changeAllReports: 'Change all reports', changeScope: 'Change scope', moderateUser: 'Moderate user', resolve: 'Resolve', diff --git a/src/views/reports/components/GroupedReport.vue b/src/views/reports/components/GroupedReport.vue index ef2dc6ce..1e6cc8fa 100644 --- a/src/views/reports/components/GroupedReport.vue +++ b/src/views/reports/components/GroupedReport.vue @@ -5,6 +5,14 @@

{{ $t('reports.reportsOn') }} {{ group.account.display_name }}

+ + {{ $t('reports.changeAllReports') }} + + {{ $t('reports.resolveAll') }} + {{ $t('reports.reopenAll') }} + {{ $t('reports.closeAll') }} + +
@@ -59,8 +67,8 @@ export default { } }, methods: { - changeMultipleReportsState(reportState, groupOfReports) { - // this.$store.dispatch('ChangeReportState', { reportState, reportId }) + changeAllReports(reportState, groupOfReports) { + console.log(groupOfReports) } } } diff --git a/src/views/reports/components/ReportCard.vue b/src/views/reports/components/ReportCard.vue index 62fa1945..823244f5 100644 --- a/src/views/reports/components/ReportCard.vue +++ b/src/views/reports/components/ReportCard.vue @@ -12,6 +12,17 @@ @{{ report.actor.acct }} +
+ {{ capitalizeFirstLetter(report.state) }} + + {{ $t('reports.changeState') }} + + {{ $t('reports.resolve') }} + {{ $t('reports.reopen') }} + {{ $t('reports.close') }} + + +
@@ -34,6 +45,22 @@ export default { } }, methods: { + capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1) + }, + changeReportState(reportState, reportId) { + this.$store.dispatch('ChangeReportState', { reportState, reportId }) + }, + getStateType(state) { + switch (state) { + case 'closed': + return 'info' + case 'resolved': + return 'success' + default: + return 'primary' + } + }, parseTimestamp(timestamp) { return moment(timestamp).format('YYYY-MM-DD HH:mm') } @@ -45,6 +72,15 @@ export default { a { text-decoration: underline; } + .el-icon-arrow-right { + margin-right: 6px; + } + .report-header { + display: flex; + justify-content: space-between; + align-items: baseline; + height: 40px; + } .report-actor { display: flex; align-items: center; @@ -78,6 +114,11 @@ export default { .el-card__header { padding: 10px 17px; } + .report-header { + display: flex; + flex-direction: column; + height: 80px; + } .report-actor-container { margin-bottom: 5px; }