Add AI form builder to guest form creation + increase timeout

This commit is contained in:
Julien Nahum 2023-03-27 15:38:45 +02:00
parent d263d56725
commit 5ba010a493
2 changed files with 13 additions and 3 deletions

View File

@ -2,6 +2,8 @@
<div class="flex flex-wrap flex-col"> <div class="flex flex-wrap flex-col">
<transition v-if="stateReady" name="fade" mode="out-in"> <transition v-if="stateReady" name="fade" mode="out-in">
<div key="2"> <div key="2">
<create-form-base-modal @form-generated="formGenerated" :show="showInitialFormModal"
@close="showInitialFormModal=false"/>
<form-editor v-if="!workspacesLoading" ref="editor" <form-editor v-if="!workspacesLoading" ref="editor"
class="w-full flex flex-grow" class="w-full flex flex-grow"
:style="{ :style="{
@ -30,6 +32,7 @@ import {mapState, mapActions} from 'vuex'
import QuickRegister from '../auth/components/QuickRegister.vue' import QuickRegister from '../auth/components/QuickRegister.vue'
import initForm from "../../mixins/form_editor/initForm.js" import initForm from "../../mixins/form_editor/initForm.js"
import SeoMeta from '../../mixins/seo-meta.js' import SeoMeta from '../../mixins/seo-meta.js'
import CreateFormBaseModal from "../../components/pages/forms/create/CreateFormBaseModal.vue"
const loadTemplates = function () { const loadTemplates = function () {
store.commit('open/templates/startLoading') store.commit('open/templates/startLoading')
@ -42,7 +45,7 @@ export default {
name: 'CreateFormGuest', name: 'CreateFormGuest',
mixins: [initForm, SeoMeta], mixins: [initForm, SeoMeta],
components: { components: {
QuickRegister QuickRegister, CreateFormBaseModal
}, },
middleware: 'guest', middleware: 'guest',
@ -60,7 +63,8 @@ export default {
error: '', error: '',
editorMaxHeight: 500, editorMaxHeight: 500,
registerModal: false, registerModal: false,
isGuest: true isGuest: true,
showInitialFormModal: false
} }
}, },
@ -108,6 +112,9 @@ export default {
if (template && template.structure) { if (template && template.structure) {
this.form = new Form({...this.form.data(), ...template.structure}) this.form = new Form({...this.form.data(), ...template.structure})
} }
} else {
// No template loaded, ask how to start
this.showInitialFormModal = true
} }
this.closeAlert() this.closeAlert()
this.stateReady = true this.stateReady = true
@ -142,6 +149,9 @@ export default {
setTimeout(() => { setTimeout(() => {
this.$refs.editor.saveFormCreate() this.$refs.editor.saveFormCreate()
}, 500) }, 500)
},
formGenerated(form) {
this.form = new Form({...this.form.data(), ...form})
} }
} }
} }

View File

@ -21,4 +21,4 @@ environments:
- 'php artisan migrate --force' - 'php artisan migrate --force'
firewall: firewall:
rate-limit: 1000 rate-limit: 1000
timeout: 60 timeout: 180