mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-21 20:12:53 +00:00
49 lines
977 B
Vue
49 lines
977 B
Vue
<template>
|
|
<Modal>
|
|
<h2 class="box-title">Create new group</h2>
|
|
<GroupForm ref="groupForm" @submitted="submitted">
|
|
<div class="actions">
|
|
<div class="align-right">
|
|
<button
|
|
class="button button-large"
|
|
:class="{ 'button-loading': loading }"
|
|
:disabled="loading"
|
|
>
|
|
Add group
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</GroupForm>
|
|
</Modal>
|
|
</template>
|
|
|
|
<script>
|
|
import GroupForm from './GroupForm'
|
|
|
|
import modal from '@/mixins/modal'
|
|
|
|
export default {
|
|
name: 'CreateGroupModal',
|
|
components: { GroupForm },
|
|
mixins: [modal],
|
|
data() {
|
|
return {
|
|
loading: false
|
|
}
|
|
},
|
|
methods: {
|
|
submitted(values) {
|
|
this.loading = true
|
|
this.$store
|
|
.dispatch('group/create', values)
|
|
.then(() => {
|
|
this.loading = false
|
|
this.hide()
|
|
})
|
|
.catch(() => {
|
|
this.loading = false
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|