Email report on every report page; kiosk long-name fix
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<h1>Warranty Report</h1>
|
||||
<div class="header-actions">
|
||||
<button v-if="!loading" class="btn btn-secondary" @click="exportCSV">Export CSV</button>
|
||||
<EmailReportButton v-if="!loading" subject="Warranty Report"
|
||||
<EmailReportButton v-if="!loading && canemail" subject="Warranty Report"
|
||||
:columns="emailColumns" :rows="emailRows" />
|
||||
<router-link to="/reports" class="btn btn-secondary">Back to Reports</router-link>
|
||||
</div>
|
||||
@@ -65,8 +65,15 @@
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { warrantyApi } from '@/api'
|
||||
import EmailReportButton from '@/components/EmailReportButton.vue'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import MachineMapChip from '../components/MachineMapChip.vue'
|
||||
|
||||
// Emailing a report is the reports.export permission the endpoint enforces.
|
||||
// Offering the button to somebody who will only get a 403 is worse than not
|
||||
// offering it.
|
||||
const authStore = useAuthStore()
|
||||
const canemail = computed(() => authStore.hasPermission('reports.export'))
|
||||
|
||||
const loading = ref(true)
|
||||
const counts = ref({})
|
||||
const buckets = ref({})
|
||||
|
||||
Reference in New Issue
Block a user