Files
716d43a9a8 Nuxt 3 migration (#4342)
Update the nuxt3 version.

Co-authored-by: Jonathan Adeline <jonathan@baserow.io>
Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
Co-authored-by: Cezary <cezary@baserow.io>
Co-authored-by: Tsering Paljor <tsering@baserow.io>
Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io>
Co-authored-by: Bram <bram2w@users.noreply.github.com>
2026-01-22 10:27:19 +01:00

84 lines
1.9 KiB
Vue

<template>
<Modal ref="modal">
<h2 class="box__title">
{{ $t('createAutomationWorkflowModal.header') }}
</h2>
<AutomationWorkflowSettingsForm
ref="automationWorkflowForm"
:automation="automation"
is-creation
@submitted="addWorkflow"
>
<div class="actions actions--right">
<Button size="large" :loading="loading">
{{ $t('createAutomationWorkflowModal.submit') }}
</Button>
</div>
</AutomationWorkflowSettingsForm>
</Modal>
</template>
<script>
import modal from '@baserow/modules/core/mixins/modal'
import { notifyIf } from '@baserow/modules/core/utils/error'
import AutomationWorkflowSettingsForm from '@baserow/modules/automation/components/workflow/settings/AutomationWorkflowSettingsForm'
export default {
name: 'CreateAutomationWorkflowModal',
components: { AutomationWorkflowSettingsForm },
mixins: [modal],
provide() {
return {
currentPage: null,
automation: this.automation,
workspace: this.workspace,
}
},
props: {
workspace: {
type: Object,
required: true,
},
automation: {
type: Object,
required: true,
},
},
data() {
return {
loading: false,
}
},
methods: {
async addWorkflow({ name }) {
this.loading = true
try {
const workflow = await this.$store.dispatch(
'automationWorkflow/create',
{
automation: this.automation,
name,
}
)
this.$refs.automationWorkflowForm.v$.$reset()
this.hide()
this.$router.push(
{
name: 'automation-workflow',
params: {
automationId: this.automation.id,
workflowId: workflow.id,
},
},
null,
() => {}
)
} catch (error) {
notifyIf(error, 'application')
}
this.loading = false
},
},
}
</script>