1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-24 21:14:05 +00:00
bramw_baserow/web-frontend/modules/database/components/view/DeleteViewModal.vue

61 lines
1.3 KiB
Vue

<template>
<Modal>
<h2 class="box__title">Delete {{ view.name }}</h2>
<Error :error="error"></Error>
<div>
<p>
Are you sure you want to delete the view <strong>{{ view.name }}</strong
>? The table data will be preserved, but the filters, sortings and field
widths related to the view will be deleted.
</p>
<div class="actions">
<div class="align-right">
<button
class="button button--large button--error"
:class="{ 'button--loading': loading }"
:disabled="loading"
@click="deleteView()"
>
Delete view
</button>
</div>
</div>
</div>
</Modal>
</template>
<script>
import modal from '@baserow/modules/core/mixins/modal'
import error from '@baserow/modules/core/mixins/error'
export default {
name: 'DeleteViewModal',
mixins: [modal, error],
props: {
view: {
type: Object,
required: true,
},
},
data() {
return {
loading: false,
}
},
methods: {
async deleteView() {
this.hideError()
this.loading = true
try {
await this.$store.dispatch('view/delete', this.view)
this.hide()
} catch (error) {
this.handleError(error, 'view')
}
this.loading = false
},
},
}
</script>