Beautiful Open-Source Form Builder
Remove initform mixin
Julien Nahum5df3245543e1
diff --git a/client/composables/forms/initForm.js b/client/composables/forms/initForm.jsindex f87b15399..70068ff78 100644--- a/client/composables/forms/initForm.js+++ b/client/composables/forms/initForm.js@@ -1,5 +1,5 @@-export const initForm = (options = {}) => {+export const initForm = (defaultValue = {}) => {return useForm({title: 'My Form',description: null,@@ -49,6 +49,6 @@ export const initForm = (options = {}) => {// Custom SEOseo_meta: {},- ...options+ ...defaultValue})}diff --git a/client/mixins/form_editor/initForm.js b/client/mixins/form_editor/initForm.jsdeleted file mode 100644index ea4737ccf..000000000--- a/client/mixins/form_editor/initForm.js+++ /dev/null@@ -1,57 +0,0 @@-import Form from "vform";--export default {- methods: {- initForm() {- this.form = new Form({- title: 'My Form',- description: null,- visibility: 'public',- workspace_id: this.workspace?.id,- properties: [],-- notifies: false,- slack_notifies: false,- send_submission_confirmation: false,- webhook_url: null,- notification_settings: {},-- // Customization- theme: 'default',- width: 'centered',- dark_mode: 'auto',- color: '#3B82F6',- hide_title: false,- no_branding: false,- uppercase_labels: true,- transparent_background: false,- closes_at: null,- closed_text: 'This form has now been closed by its owner and does not accept submissions anymore.',- auto_save: true,-- // Submission- submit_button_text: 'Submit',- re_fillable: false,- re_fill_button_text: 'Fill Again',- submitted_text: 'Amazing, we saved your answers. Thank you for your time and have a great day!',- notification_sender: 'OpnForm',- notification_subject: 'We saved your answers',- notification_body: 'Hello there 👋 <br>This is a confirmation that your submission was successfully saved.',- notifications_include_submission: true,- use_captcha: false,- is_rating: false,- rating_max_value: 5,- max_submissions_count: null,- max_submissions_reached_text: 'This form has now reached the maximum number of allowed submissions and is now closed.',- editable_submissions_button_text: 'Edit submission',- confetti_on_submission: false,-- // Security & Privacy- can_be_indexed: true,-- // Custom SEO- seo_meta: {}- })- },- }-}diff --git a/client/pages/forms/create/guest.vue b/client/pages/forms/create/guest.vueindex 2cd100b70..13ba3b77e 100644--- a/client/pages/forms/create/guest.vue+++ b/client/pages/forms/create/guest.vue@@ -24,9 +24,8 @@</template><script>-import { computed } from 'vue'+import {initForm} from "~/composables/forms/initForm.js"import QuickRegister from '~/components/pages/auth/components/QuickRegister.vue'-import initForm from '../../../mixins/form_editor/initForm.js'import CreateFormBaseModal from '../../../components/pages/forms/create/CreateFormBaseModal.vue'const loadTemplates = function () {@@ -42,7 +41,6 @@ export default {components: {QuickRegister, CreateFormBaseModal},- mixins: [initForm],middleware: 'guest',beforeRouteEnter (to, from, next) {@@ -109,7 +107,7 @@ export default {this.workspacesStore.set([guestWorkspace])this.workspacesStore.setCurrentId(guestWorkspace.id)- this.initForm()+ this.form = initForm()if (this.$route.query.template !== undefined && this.$route.query.template) {const template = this.templatesStore.getByKey(this.$route.query.template)if (template && template.structure) {