mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-17 10:14:08 +00:00
SendInvoiceModal and SendEstimateModal were only mounted on detail views. Resend from table dropdowns did nothing because the modal component was not in the DOM. Added to index views and dashboard. Pass canCreatePayment and canCreateEstimate props to InvoiceDropdown from detail view and dashboard.
36 lines
1.1 KiB
Vue
36 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
import { onMounted } from 'vue'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import { useUserStore } from '../../../../stores/user.store'
|
|
import DashboardStats from '../components/DashboardStats.vue'
|
|
import DashboardChart from '../components/DashboardChart.vue'
|
|
import DashboardTable from '../components/DashboardTable.vue'
|
|
import SendInvoiceModal from '@v2/features/company/invoices/components/SendInvoiceModal.vue'
|
|
import SendEstimateModal from '@v2/features/company/estimates/components/SendEstimateModal.vue'
|
|
|
|
const route = useRoute()
|
|
const router = useRouter()
|
|
const userStore = useUserStore()
|
|
|
|
onMounted(() => {
|
|
const meta = route.meta as { ability?: string; isOwner?: boolean }
|
|
|
|
if (meta.ability && !userStore.hasAbilities(meta.ability)) {
|
|
router.push({ name: 'settings.account' })
|
|
} else if (meta.isOwner && !userStore.isOwner) {
|
|
router.push({ name: 'settings.account' })
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<BasePage>
|
|
<DashboardStats />
|
|
<DashboardChart />
|
|
<DashboardTable />
|
|
</BasePage>
|
|
|
|
<SendInvoiceModal />
|
|
<SendEstimateModal />
|
|
</template>
|