1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-01-15 21:18:41 +00:00
bramw_baserow/web-frontend/modules/dashboard/components/DashboardTemplate.vue
2025-01-07 17:32:50 +00:00

52 lines
1.1 KiB
Vue

<template>
<Dashboard :dashboard="pageValue.dashboard" store-prefix="template/" />
</template>
<script>
import Dashboard from '@baserow/modules/dashboard/components/Dashboard'
import { notifyIf } from '@baserow/modules/core/utils/error'
export default {
name: 'DashboardTemplate',
components: { Dashboard },
props: {
pageValue: {
type: Object,
required: true,
},
},
watch: {
pageValue: {
handler(pageValue) {
this.fetchDashboard(pageValue.dashboard)
},
},
},
mounted() {
this.fetchDashboard(this.pageValue.dashboard)
},
methods: {
async fetchDashboard(dashboard) {
try {
await this.$store.dispatch(
'template/dashboardApplication/setLoading',
true
)
await this.$store.dispatch(
'template/dashboardApplication/fetchInitial',
{
dashboardId: dashboard.id,
forEditing: false,
}
)
await this.$store.dispatch(
'template/dashboardApplication/setLoading',
false
)
} catch (error) {
notifyIf(error, 'dashboard')
}
},
},
}
</script>