mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-01-15 21:18:41 +00:00
51 lines
1.2 KiB
Vue
51 lines
1.2 KiB
Vue
<template>
|
|
<div class="empty-dashboard">
|
|
<div class="empty-dashboard__content">
|
|
<div class="empty-dashboard__content-title">
|
|
{{ $t('emptyDashboard.title') }}
|
|
</div>
|
|
<div v-if="canCreateWidget()" class="empty-dashboard__content-subtitle">
|
|
{{ $t('emptyDashboard.subtitle') }}
|
|
</div>
|
|
<Button
|
|
v-if="canCreateWidget()"
|
|
type="primary"
|
|
icon="iconoir-plus"
|
|
@click="openCreateWidgetModal"
|
|
>{{ $t('emptyDashboard.addWidget') }}</Button
|
|
>
|
|
</div>
|
|
<CreateWidgetModal
|
|
ref="createWidgetModal"
|
|
:dashboard="dashboard"
|
|
@widget-type-selected="$emit('widget-type-selected', $event)"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import CreateWidgetModal from '@baserow/modules/dashboard/components/CreateWidgetModal'
|
|
|
|
export default {
|
|
name: 'EmptyDashboard',
|
|
components: { CreateWidgetModal },
|
|
props: {
|
|
dashboard: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
},
|
|
methods: {
|
|
openCreateWidgetModal() {
|
|
this.$refs.createWidgetModal.show()
|
|
},
|
|
canCreateWidget() {
|
|
return this.$hasPermission(
|
|
'dashboard.create_widget',
|
|
this.dashboard,
|
|
this.dashboard.workspace.id
|
|
)
|
|
},
|
|
},
|
|
}
|
|
</script>
|