Skip to content

Commit

Permalink
Enhance form components by adding 'creating' prop for improved state …
Browse files Browse the repository at this point in the history
…management

- Introduced a new 'creating' Boolean prop in OpenForm.vue and OpenFormFocused.vue to manage form submission state.
- Updated the nextPage method to include 'creating' in the condition for advancing the form page index, ensuring proper navigation during form creation.
- Adjusted OpenCompleteForm.vue to bind the 'creating' prop, enhancing the overall functionality and user experience of the form components.
  • Loading branch information
chiragchhatrala committed Dec 10, 2024
1 parent 0db1fc0 commit f24cab9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions client/components/open/forms/OpenCompleteForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
:theme="theme"
:dark-mode="darkMode"
:admin-preview="adminPreview"
:creating="creating"
@submit="submitForm"
>
<template #submit-btn="{submitForm}">
Expand All @@ -138,6 +139,7 @@
:theme="theme"
:dark-mode="darkMode"
:admin-preview="adminPreview"
:creating="creating"
@submit="submitForm"
>
<template #submit-btn="{submitForm}">
Expand Down
3 changes: 2 additions & 1 deletion client/components/open/forms/OpenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export default {
required: true
},
defaultDataForm: { type: [Object, null] },
creating: {type: Boolean, default: false},
adminPreview: {type: Boolean, default: false}, // If used in FormEditorPreview
urlPrefillPreview: {type: Boolean, default: false}, // If used in UrlFormPrefill
darkMode: {
Expand Down Expand Up @@ -528,7 +529,7 @@ export default {
this.scrollToTop()
},
nextPage() {
if (this.adminPreview || this.urlPrefillPreview) {
if (this.adminPreview || this.urlPrefillPreview || this.creating) {
this.formPageIndex++
this.scrollToTop()
return false
Expand Down
3 changes: 2 additions & 1 deletion client/components/open/forms/OpenFormFocused.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export default {
required: true
},
defaultDataForm: { type: [Object, null] },
creating: {type: Boolean, default: false},
adminPreview: {type: Boolean, default: false}, // If used in FormEditorPreview
urlPrefillPreview: {type: Boolean, default: false}, // If used in UrlFormPrefill
darkMode: {
Expand Down Expand Up @@ -469,7 +470,7 @@ export default {
this.scrollToTop()
},
nextPage() {
if (this.adminPreview || this.urlPrefillPreview) {
if (this.adminPreview || this.urlPrefillPreview || this.creating) {
this.formPageIndex++
this.scrollToTop()
return false
Expand Down

0 comments on commit f24cab9

Please sign in to comment.