2023-12-09 15:47:03 +01:00
|
|
|
<template>
|
2024-04-15 19:39:03 +02:00
|
|
|
<form
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
v-if="form"
|
2024-04-15 19:39:03 +02:00
|
|
|
@submit.prevent=""
|
|
|
|
|
>
|
2025-04-08 10:20:51 +02:00
|
|
|
<FormProgressbar
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
:form-manager="formManager"
|
|
|
|
|
:theme="theme"
|
2025-04-08 10:20:51 +02:00
|
|
|
/>
|
2024-04-15 19:39:03 +02:00
|
|
|
<transition
|
|
|
|
|
name="fade"
|
|
|
|
|
mode="out-in"
|
|
|
|
|
>
|
|
|
|
|
<div
|
2024-09-23 20:02:38 +02:00
|
|
|
:key="formPageIndex"
|
2024-04-15 19:39:03 +02:00
|
|
|
class="form-group flex flex-wrap w-full"
|
|
|
|
|
>
|
|
|
|
|
<draggable
|
2024-05-13 14:47:59 +02:00
|
|
|
:list="currentFields"
|
|
|
|
|
group="form-elements"
|
2024-04-15 19:39:03 +02:00
|
|
|
item-key="id"
|
2024-05-14 17:17:28 +02:00
|
|
|
class="grid grid-cols-12 relative transition-all w-full"
|
Stripe Payment (#679)
* oAuth for Stripe
* Stripe Payment Frontend - WIP
* Payment block backend validation and new package for stripe
* change stripe scopes
* update PaymentBlockConfigurationRule
* Set loader on provider modal
* stripe oauth
* PaymentFieldOptions as seprate component
* validate Stripe account
* Payment intent
* Stripe Payment as composable
* confirmCardPayment working
* Set payment errors on form.errors
* Validate card other fields
* Store payment id to database and on submission add link for view payment on stripe
* FormPaymentController no need auth middleware
* paymentinput error display on field
* Make payment block as input
change 'nf-payment' to 'payment'
* Refactor payment processing and error handling
* Multi lang & direction support on payment
* reset card on change direction or local
* use connected account for loadstripe
* validate OAuthProvider before delete it
* payment improvements
* display payment by stripe
* use stripe_currencies.json
* Form Payment testcase
* Enhance form auto-save behavior for payment forms
* Restrict payment block in self-hosted environments
* validate form before process payment
* Refactor Nuxt Configuration for Improved Development Server Settings
- Removed the existing Vite server configuration for hot module replacement (HMR) as it was no longer necessary.
- Introduced a new `devServer` configuration to specify the host and port for the development server, allowing for more flexible environment setup based on environment variables.
These changes aim to streamline the development process by enhancing server configuration and ensuring better adaptability to different environments.
* Enhance Payment Handling and User Experience in Forms
- Refactored `FormPaymentController` to improve handling of Stripe account retrieval, including better error messages for both editor preview and public forms.
- Updated `OAuthProviderController` to utilize caching for OAuth connection context, enhancing performance and user experience during account connections.
- Improved `PaymentInput.client.vue` to display a loading state and a preview message for users, guiding them to save the form for payment activation.
- Modified various components to standardize payment-related messages and improve localization support across multiple languages.
- Removed the deprecated `connections.vue` page to streamline the codebase.
These changes aim to enhance the overall user experience when handling payments and improve the maintainability of the payment-related components.
* Refactor Payment Handling and Enhance User Experience in Forms
- Updated `FormPaymentController` to utilize a new method for checking if the Stripe provider belongs to any workspace user, improving security and error logging.
- Modified `OAuthProviderController` to streamline the OAuth provider creation process by directly using the service object.
- Enhanced `Workspace` model with a new method to verify provider ownership, improving code clarity and maintainability.
- Improved `PaymentInput.client.vue` to handle loading states and error messages more effectively, enhancing user feedback during payment processing.
- Refactored `useFormInput.js` to include an `isAdminPreview` prop for better context handling in form components.
These changes aim to improve the overall user experience when handling payments and enhance the maintainability of the payment-related components.
* Enhance Payment Validation and User Experience in Forms
- Updated `UserFormRequest` to improve workspace handling during form submissions, allowing for better context in validation rules.
- Modified `PaymentBlockConfigurationRule` to include workspace validation, ensuring that payment providers are associated with the correct workspace, enhancing security and error logging.
- Improved `PaymentInput.client.vue` to dynamically determine the success state of payment processing, providing clearer user feedback.
- Updated various localization files to include a payment disclaimer, ensuring users are informed about credit card charges during payment processing.
These changes aim to enhance the overall user experience when handling payments and improve the maintainability of payment-related components.
* Enhance Payment Features and User Experience in Forms
- Added checks in `FormPaymentController` to disable payment features for self-hosted instances, improving clarity for users regarding feature availability.
- Updated `PaymentBlockConfigurationRule` to change the minimum amount validation from 0.5 to 1, ensuring stricter payment requirements.
- Enhanced `PaymentInput.client.vue` with dark mode support for various UI elements, improving accessibility and user experience in different themes.
- Modified `useFormInput.js` to include an `isDark` prop, allowing for better theme handling in form components.
- Updated error messages in `useStripeElements.js` to include periods for consistency and improved user feedback.
These changes aim to enhance the overall user experience when handling payments and improve the maintainability of payment-related components.
* Enhance Payment Input Component with Focus Handling and Theme Support
- Updated `PaymentInput.client.vue` to include focus and blur event handlers, improving user interaction by visually indicating when the card input is focused.
- Enhanced theme support by adding new properties in `form-themes.js` for `PaymentInput`, allowing for better styling and transitions based on focus state.
- Introduced a new `isCardFocused` reactive reference to manage the focus state of the card input, enhancing the overall user experience.
These changes aim to improve the usability and visual feedback of the payment input component, aligning with recent enhancements to user experience in payment forms.
* Refactor Payment Handling and Improve Code Consistency
- Updated various files to enhance code consistency by adding spaces in arrow function definitions, improving readability and adhering to coding standards.
- Modified `PaymentBlockConfigurationRule.php`, `FormPaymentController.php`, and `Workspace.php` to ensure uniformity in the use of arrow functions.
- Enhanced `PaymentInput.client.vue` and other components by improving the formatting of template elements for better visual structure.
- Updated `useStripeElements.js` to streamline state management and improve clarity in the handling of Stripe elements.
These changes aim to improve code maintainability and readability across the payment handling components, ensuring a more consistent coding style throughout the codebase.
* Enhance Form Model and Logging Configuration
- Added a new 'auto_save' boolean property to the Form model, allowing for automatic saving of form data.
- Updated the logging configuration to include a 'combined' channel that stacks multiple log channels, improving logging flexibility and error tracking.
- Modified the FormFactory to set a default value for 'auto_save' to false, ensuring consistent behavior across form instances.
- Improved error message structure in FormPaymentTest to provide clearer feedback when a payment block is missing.
These changes aim to enhance the functionality of forms and improve logging capabilities, contributing to better maintainability and user experience.
* Update api/config/logging.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Refactor Payment Error Handling and Localization Updates
- Updated `FormPaymentTest.php` to improve code consistency by adding spaces in arrow function definitions, enhancing readability.
- Modified `useStripeElements.js` to replace hardcoded error messages with localized strings, improving user experience and maintainability.
- Enhanced various localization files (e.g., `en.json`, `fr.json`, `de.json`, etc.) to include new error messages related to payment processing, ensuring users receive clear and consistent feedback across different languages.
These changes aim to enhance the clarity of error handling in payment processes and improve the overall user experience through better localization support.
* Enhance AddFormBlock and FieldOptions with Authentication Checks
- Added an icon to indicate authentication requirements for blocks in `AddFormBlock.vue`, improving user awareness of access restrictions.
- Implemented alert notifications using `useAlert()` for unauthorized block additions and input cloning, enhancing user feedback.
- Updated `FieldOptions.vue` to conditionally render payment field options, ensuring relevant options are displayed based on the field type.
- Modified `blocks_types.json` to include an `auth_required` property for specific block types, facilitating authentication checks.
These changes aim to improve user experience by providing clear indications of authentication requirements and enhancing form functionality.
* Enhance Authentication Checks in AddFormBlock Component
- Updated `AddFormBlock.vue` to conditionally render authentication-required icons based on user authentication status, improving user awareness of access restrictions.
- Implemented additional authentication checks in the `addBlock` and `handleInputClone` functions, utilizing `useAlert()` for notifying users when login is required to add blocks or clone inputs.
- Introduced a computed property to manage the authenticated state, streamlining the authentication logic within the component.
These changes aim to enhance user experience by providing clear indications of authentication requirements and improving the functionality of the form component.
* Enhance PaymentInput Component with Disabled State Support
- Updated `PaymentInput.client.vue` to include a `disabled` prop for the card holder name and email inputs, improving form accessibility and user experience by preventing interaction when necessary.
- Modified the card options to respect the `disabled` state, ensuring consistent behavior across the payment input fields.
These changes aim to enhance the usability of the payment input component by providing better control over user interactions.
* Add Payment Condition Logic and Update Filters
- Introduced a new payment condition in `FormLogicConditionChecker.php` to handle 'paid' and 'not_paid' states, enhancing form logic capabilities.
- Added corresponding payment comparators in `open_filters.json` for both API and client, ensuring consistent validation and expected types for payment conditions.
- Updated the JavaScript logic in `FormLogicConditionChecker.js` to include the new payment condition checks, improving the overall functionality of form conditions.
These changes aim to enhance the form logic related to payment states, providing better validation and user experience in payment-related forms.
* Refactor Authentication Checks in AddFormBlock and Working Form Store
- Removed redundant authentication checks from `AddFormBlock.vue` for adding blocks and cloning inputs, streamlining the logic.
- Centralized authentication validation in `working_form.js` to ensure consistent user feedback when authentication is required for specific block types.
- Enhanced user experience by utilizing `useAlert()` for notifying users about login requirements, improving clarity and interaction.
These changes aim to simplify the authentication logic and improve user notifications regarding access restrictions in form components.
* Refactor Feature Flags and Update Payment Input Logic
- Updated `FeatureFlagsController.php` to utilize the `Cache` facade directly, improving code clarity and consistency.
- Modified `PaymentInput.client.vue` to enhance the display logic for payment previews, ensuring a better user experience by conditionally showing messages based on the state of the Stripe account.
- Removed the `STRIPE_PUBLISHABLE_KEY` from `runtimeConfig.js` to streamline the configuration and replaced it with a computed property that retrieves the key from feature flags, improving maintainability.
- Adjusted the `.env.example` file to maintain consistency in environment variable definitions.
These changes aim to enhance the clarity of feature flag management and improve the user experience in payment interactions by refining the logic and configuration handling.
* Update Stripe Configuration in Services
- Modified the `services.php` configuration file to enhance the Stripe integration by providing default values for `client_secret` and `redirect` URI. This change ensures that the application can fallback to a predefined secret and a specific callback URL, improving the robustness of the payment service setup.
These changes aim to streamline the configuration process for Stripe, ensuring that necessary values are always available for the application to function correctly.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-04-10 12:04:25 +02:00
|
|
|
:class="[
|
|
|
|
|
draggingNewBlock ? 'rounded-md bg-blue-50 dark:bg-gray-800' : '',
|
|
|
|
|
]"
|
2024-04-15 19:39:03 +02:00
|
|
|
ghost-class="ghost-item"
|
2024-09-23 20:02:38 +02:00
|
|
|
filter=".not-draggable"
|
2024-04-15 19:39:03 +02:00
|
|
|
:animation="200"
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
:disabled="!allowDragging"
|
2024-05-13 14:47:59 +02:00
|
|
|
@change="handleDragDropped"
|
2023-12-09 15:47:03 +01:00
|
|
|
>
|
|
|
|
|
<template #item="{element}">
|
|
|
|
|
<open-form-field
|
|
|
|
|
:field="element"
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
:form-manager="formManager"
|
2023-12-09 15:47:03 +01:00
|
|
|
:theme="theme"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</draggable>
|
|
|
|
|
</div>
|
|
|
|
|
</transition>
|
|
|
|
|
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
<!-- Replace Captcha with CaptchaWrapper -->
|
|
|
|
|
<CaptchaWrapper
|
|
|
|
|
v-if="form.use_captcha"
|
|
|
|
|
:form-manager="formManager"
|
|
|
|
|
:theme="theme"
|
|
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
|
|
|
|
|
<!-- Submit, Next and previous buttons -->
|
|
|
|
|
<div class="flex flex-wrap justify-center w-full">
|
2024-04-15 19:39:03 +02:00
|
|
|
<open-form-button
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
v-if="formPageIndex>0 && previousFieldsPageBreak"
|
2024-04-15 19:39:03 +02:00
|
|
|
native-type="button"
|
|
|
|
|
:color="form.color"
|
|
|
|
|
:theme="theme"
|
|
|
|
|
class="mt-2 px-8 mx-1"
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
@click="handlePreviousClick"
|
2023-12-09 15:47:03 +01:00
|
|
|
>
|
|
|
|
|
{{ previousFieldsPageBreak.previous_btn_text }}
|
|
|
|
|
</open-form-button>
|
|
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<slot
|
|
|
|
|
v-if="isLastPage"
|
|
|
|
|
name="submit-btn"
|
2025-05-19 14:53:30 +02:00
|
|
|
:loading="isProcessing"
|
2024-04-15 19:39:03 +02:00
|
|
|
/>
|
|
|
|
|
<open-form-button
|
|
|
|
|
v-else-if="currentFieldsPageBreak"
|
|
|
|
|
native-type="button"
|
|
|
|
|
:color="form.color"
|
|
|
|
|
:theme="theme"
|
|
|
|
|
class="mt-2 px-8 mx-1"
|
2025-05-19 14:53:30 +02:00
|
|
|
:loading="isProcessing"
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
@click.stop="handleNextClick"
|
2023-12-09 15:47:03 +01:00
|
|
|
>
|
|
|
|
|
{{ currentFieldsPageBreak.next_btn_text }}
|
|
|
|
|
</open-form-button>
|
|
|
|
|
<div v-if="!currentFieldsPageBreak && !isLastPage">
|
2024-12-04 18:32:14 +01:00
|
|
|
{{ $t('forms.wrong_form_structure') }}
|
2023-12-09 15:47:03 +01:00
|
|
|
</div>
|
Stripe Payment (#679)
* oAuth for Stripe
* Stripe Payment Frontend - WIP
* Payment block backend validation and new package for stripe
* change stripe scopes
* update PaymentBlockConfigurationRule
* Set loader on provider modal
* stripe oauth
* PaymentFieldOptions as seprate component
* validate Stripe account
* Payment intent
* Stripe Payment as composable
* confirmCardPayment working
* Set payment errors on form.errors
* Validate card other fields
* Store payment id to database and on submission add link for view payment on stripe
* FormPaymentController no need auth middleware
* paymentinput error display on field
* Make payment block as input
change 'nf-payment' to 'payment'
* Refactor payment processing and error handling
* Multi lang & direction support on payment
* reset card on change direction or local
* use connected account for loadstripe
* validate OAuthProvider before delete it
* payment improvements
* display payment by stripe
* use stripe_currencies.json
* Form Payment testcase
* Enhance form auto-save behavior for payment forms
* Restrict payment block in self-hosted environments
* validate form before process payment
* Refactor Nuxt Configuration for Improved Development Server Settings
- Removed the existing Vite server configuration for hot module replacement (HMR) as it was no longer necessary.
- Introduced a new `devServer` configuration to specify the host and port for the development server, allowing for more flexible environment setup based on environment variables.
These changes aim to streamline the development process by enhancing server configuration and ensuring better adaptability to different environments.
* Enhance Payment Handling and User Experience in Forms
- Refactored `FormPaymentController` to improve handling of Stripe account retrieval, including better error messages for both editor preview and public forms.
- Updated `OAuthProviderController` to utilize caching for OAuth connection context, enhancing performance and user experience during account connections.
- Improved `PaymentInput.client.vue` to display a loading state and a preview message for users, guiding them to save the form for payment activation.
- Modified various components to standardize payment-related messages and improve localization support across multiple languages.
- Removed the deprecated `connections.vue` page to streamline the codebase.
These changes aim to enhance the overall user experience when handling payments and improve the maintainability of the payment-related components.
* Refactor Payment Handling and Enhance User Experience in Forms
- Updated `FormPaymentController` to utilize a new method for checking if the Stripe provider belongs to any workspace user, improving security and error logging.
- Modified `OAuthProviderController` to streamline the OAuth provider creation process by directly using the service object.
- Enhanced `Workspace` model with a new method to verify provider ownership, improving code clarity and maintainability.
- Improved `PaymentInput.client.vue` to handle loading states and error messages more effectively, enhancing user feedback during payment processing.
- Refactored `useFormInput.js` to include an `isAdminPreview` prop for better context handling in form components.
These changes aim to improve the overall user experience when handling payments and enhance the maintainability of the payment-related components.
* Enhance Payment Validation and User Experience in Forms
- Updated `UserFormRequest` to improve workspace handling during form submissions, allowing for better context in validation rules.
- Modified `PaymentBlockConfigurationRule` to include workspace validation, ensuring that payment providers are associated with the correct workspace, enhancing security and error logging.
- Improved `PaymentInput.client.vue` to dynamically determine the success state of payment processing, providing clearer user feedback.
- Updated various localization files to include a payment disclaimer, ensuring users are informed about credit card charges during payment processing.
These changes aim to enhance the overall user experience when handling payments and improve the maintainability of payment-related components.
* Enhance Payment Features and User Experience in Forms
- Added checks in `FormPaymentController` to disable payment features for self-hosted instances, improving clarity for users regarding feature availability.
- Updated `PaymentBlockConfigurationRule` to change the minimum amount validation from 0.5 to 1, ensuring stricter payment requirements.
- Enhanced `PaymentInput.client.vue` with dark mode support for various UI elements, improving accessibility and user experience in different themes.
- Modified `useFormInput.js` to include an `isDark` prop, allowing for better theme handling in form components.
- Updated error messages in `useStripeElements.js` to include periods for consistency and improved user feedback.
These changes aim to enhance the overall user experience when handling payments and improve the maintainability of payment-related components.
* Enhance Payment Input Component with Focus Handling and Theme Support
- Updated `PaymentInput.client.vue` to include focus and blur event handlers, improving user interaction by visually indicating when the card input is focused.
- Enhanced theme support by adding new properties in `form-themes.js` for `PaymentInput`, allowing for better styling and transitions based on focus state.
- Introduced a new `isCardFocused` reactive reference to manage the focus state of the card input, enhancing the overall user experience.
These changes aim to improve the usability and visual feedback of the payment input component, aligning with recent enhancements to user experience in payment forms.
* Refactor Payment Handling and Improve Code Consistency
- Updated various files to enhance code consistency by adding spaces in arrow function definitions, improving readability and adhering to coding standards.
- Modified `PaymentBlockConfigurationRule.php`, `FormPaymentController.php`, and `Workspace.php` to ensure uniformity in the use of arrow functions.
- Enhanced `PaymentInput.client.vue` and other components by improving the formatting of template elements for better visual structure.
- Updated `useStripeElements.js` to streamline state management and improve clarity in the handling of Stripe elements.
These changes aim to improve code maintainability and readability across the payment handling components, ensuring a more consistent coding style throughout the codebase.
* Enhance Form Model and Logging Configuration
- Added a new 'auto_save' boolean property to the Form model, allowing for automatic saving of form data.
- Updated the logging configuration to include a 'combined' channel that stacks multiple log channels, improving logging flexibility and error tracking.
- Modified the FormFactory to set a default value for 'auto_save' to false, ensuring consistent behavior across form instances.
- Improved error message structure in FormPaymentTest to provide clearer feedback when a payment block is missing.
These changes aim to enhance the functionality of forms and improve logging capabilities, contributing to better maintainability and user experience.
* Update api/config/logging.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Refactor Payment Error Handling and Localization Updates
- Updated `FormPaymentTest.php` to improve code consistency by adding spaces in arrow function definitions, enhancing readability.
- Modified `useStripeElements.js` to replace hardcoded error messages with localized strings, improving user experience and maintainability.
- Enhanced various localization files (e.g., `en.json`, `fr.json`, `de.json`, etc.) to include new error messages related to payment processing, ensuring users receive clear and consistent feedback across different languages.
These changes aim to enhance the clarity of error handling in payment processes and improve the overall user experience through better localization support.
* Enhance AddFormBlock and FieldOptions with Authentication Checks
- Added an icon to indicate authentication requirements for blocks in `AddFormBlock.vue`, improving user awareness of access restrictions.
- Implemented alert notifications using `useAlert()` for unauthorized block additions and input cloning, enhancing user feedback.
- Updated `FieldOptions.vue` to conditionally render payment field options, ensuring relevant options are displayed based on the field type.
- Modified `blocks_types.json` to include an `auth_required` property for specific block types, facilitating authentication checks.
These changes aim to improve user experience by providing clear indications of authentication requirements and enhancing form functionality.
* Enhance Authentication Checks in AddFormBlock Component
- Updated `AddFormBlock.vue` to conditionally render authentication-required icons based on user authentication status, improving user awareness of access restrictions.
- Implemented additional authentication checks in the `addBlock` and `handleInputClone` functions, utilizing `useAlert()` for notifying users when login is required to add blocks or clone inputs.
- Introduced a computed property to manage the authenticated state, streamlining the authentication logic within the component.
These changes aim to enhance user experience by providing clear indications of authentication requirements and improving the functionality of the form component.
* Enhance PaymentInput Component with Disabled State Support
- Updated `PaymentInput.client.vue` to include a `disabled` prop for the card holder name and email inputs, improving form accessibility and user experience by preventing interaction when necessary.
- Modified the card options to respect the `disabled` state, ensuring consistent behavior across the payment input fields.
These changes aim to enhance the usability of the payment input component by providing better control over user interactions.
* Add Payment Condition Logic and Update Filters
- Introduced a new payment condition in `FormLogicConditionChecker.php` to handle 'paid' and 'not_paid' states, enhancing form logic capabilities.
- Added corresponding payment comparators in `open_filters.json` for both API and client, ensuring consistent validation and expected types for payment conditions.
- Updated the JavaScript logic in `FormLogicConditionChecker.js` to include the new payment condition checks, improving the overall functionality of form conditions.
These changes aim to enhance the form logic related to payment states, providing better validation and user experience in payment-related forms.
* Refactor Authentication Checks in AddFormBlock and Working Form Store
- Removed redundant authentication checks from `AddFormBlock.vue` for adding blocks and cloning inputs, streamlining the logic.
- Centralized authentication validation in `working_form.js` to ensure consistent user feedback when authentication is required for specific block types.
- Enhanced user experience by utilizing `useAlert()` for notifying users about login requirements, improving clarity and interaction.
These changes aim to simplify the authentication logic and improve user notifications regarding access restrictions in form components.
* Refactor Feature Flags and Update Payment Input Logic
- Updated `FeatureFlagsController.php` to utilize the `Cache` facade directly, improving code clarity and consistency.
- Modified `PaymentInput.client.vue` to enhance the display logic for payment previews, ensuring a better user experience by conditionally showing messages based on the state of the Stripe account.
- Removed the `STRIPE_PUBLISHABLE_KEY` from `runtimeConfig.js` to streamline the configuration and replaced it with a computed property that retrieves the key from feature flags, improving maintainability.
- Adjusted the `.env.example` file to maintain consistency in environment variable definitions.
These changes aim to enhance the clarity of feature flag management and improve the user experience in payment interactions by refining the logic and configuration handling.
* Update Stripe Configuration in Services
- Modified the `services.php` configuration file to enhance the Stripe integration by providing default values for `client_secret` and `redirect` URI. This change ensures that the application can fallback to a predefined secret and a specific callback URL, improving the robustness of the payment service setup.
These changes aim to streamline the configuration process for Stripe, ensuring that necessary values are always available for the application to function correctly.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-04-10 12:04:25 +02:00
|
|
|
<div
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
v-if="hasPaymentBlock"
|
Stripe Payment (#679)
* oAuth for Stripe
* Stripe Payment Frontend - WIP
* Payment block backend validation and new package for stripe
* change stripe scopes
* update PaymentBlockConfigurationRule
* Set loader on provider modal
* stripe oauth
* PaymentFieldOptions as seprate component
* validate Stripe account
* Payment intent
* Stripe Payment as composable
* confirmCardPayment working
* Set payment errors on form.errors
* Validate card other fields
* Store payment id to database and on submission add link for view payment on stripe
* FormPaymentController no need auth middleware
* paymentinput error display on field
* Make payment block as input
change 'nf-payment' to 'payment'
* Refactor payment processing and error handling
* Multi lang & direction support on payment
* reset card on change direction or local
* use connected account for loadstripe
* validate OAuthProvider before delete it
* payment improvements
* display payment by stripe
* use stripe_currencies.json
* Form Payment testcase
* Enhance form auto-save behavior for payment forms
* Restrict payment block in self-hosted environments
* validate form before process payment
* Refactor Nuxt Configuration for Improved Development Server Settings
- Removed the existing Vite server configuration for hot module replacement (HMR) as it was no longer necessary.
- Introduced a new `devServer` configuration to specify the host and port for the development server, allowing for more flexible environment setup based on environment variables.
These changes aim to streamline the development process by enhancing server configuration and ensuring better adaptability to different environments.
* Enhance Payment Handling and User Experience in Forms
- Refactored `FormPaymentController` to improve handling of Stripe account retrieval, including better error messages for both editor preview and public forms.
- Updated `OAuthProviderController` to utilize caching for OAuth connection context, enhancing performance and user experience during account connections.
- Improved `PaymentInput.client.vue` to display a loading state and a preview message for users, guiding them to save the form for payment activation.
- Modified various components to standardize payment-related messages and improve localization support across multiple languages.
- Removed the deprecated `connections.vue` page to streamline the codebase.
These changes aim to enhance the overall user experience when handling payments and improve the maintainability of the payment-related components.
* Refactor Payment Handling and Enhance User Experience in Forms
- Updated `FormPaymentController` to utilize a new method for checking if the Stripe provider belongs to any workspace user, improving security and error logging.
- Modified `OAuthProviderController` to streamline the OAuth provider creation process by directly using the service object.
- Enhanced `Workspace` model with a new method to verify provider ownership, improving code clarity and maintainability.
- Improved `PaymentInput.client.vue` to handle loading states and error messages more effectively, enhancing user feedback during payment processing.
- Refactored `useFormInput.js` to include an `isAdminPreview` prop for better context handling in form components.
These changes aim to improve the overall user experience when handling payments and enhance the maintainability of the payment-related components.
* Enhance Payment Validation and User Experience in Forms
- Updated `UserFormRequest` to improve workspace handling during form submissions, allowing for better context in validation rules.
- Modified `PaymentBlockConfigurationRule` to include workspace validation, ensuring that payment providers are associated with the correct workspace, enhancing security and error logging.
- Improved `PaymentInput.client.vue` to dynamically determine the success state of payment processing, providing clearer user feedback.
- Updated various localization files to include a payment disclaimer, ensuring users are informed about credit card charges during payment processing.
These changes aim to enhance the overall user experience when handling payments and improve the maintainability of payment-related components.
* Enhance Payment Features and User Experience in Forms
- Added checks in `FormPaymentController` to disable payment features for self-hosted instances, improving clarity for users regarding feature availability.
- Updated `PaymentBlockConfigurationRule` to change the minimum amount validation from 0.5 to 1, ensuring stricter payment requirements.
- Enhanced `PaymentInput.client.vue` with dark mode support for various UI elements, improving accessibility and user experience in different themes.
- Modified `useFormInput.js` to include an `isDark` prop, allowing for better theme handling in form components.
- Updated error messages in `useStripeElements.js` to include periods for consistency and improved user feedback.
These changes aim to enhance the overall user experience when handling payments and improve the maintainability of payment-related components.
* Enhance Payment Input Component with Focus Handling and Theme Support
- Updated `PaymentInput.client.vue` to include focus and blur event handlers, improving user interaction by visually indicating when the card input is focused.
- Enhanced theme support by adding new properties in `form-themes.js` for `PaymentInput`, allowing for better styling and transitions based on focus state.
- Introduced a new `isCardFocused` reactive reference to manage the focus state of the card input, enhancing the overall user experience.
These changes aim to improve the usability and visual feedback of the payment input component, aligning with recent enhancements to user experience in payment forms.
* Refactor Payment Handling and Improve Code Consistency
- Updated various files to enhance code consistency by adding spaces in arrow function definitions, improving readability and adhering to coding standards.
- Modified `PaymentBlockConfigurationRule.php`, `FormPaymentController.php`, and `Workspace.php` to ensure uniformity in the use of arrow functions.
- Enhanced `PaymentInput.client.vue` and other components by improving the formatting of template elements for better visual structure.
- Updated `useStripeElements.js` to streamline state management and improve clarity in the handling of Stripe elements.
These changes aim to improve code maintainability and readability across the payment handling components, ensuring a more consistent coding style throughout the codebase.
* Enhance Form Model and Logging Configuration
- Added a new 'auto_save' boolean property to the Form model, allowing for automatic saving of form data.
- Updated the logging configuration to include a 'combined' channel that stacks multiple log channels, improving logging flexibility and error tracking.
- Modified the FormFactory to set a default value for 'auto_save' to false, ensuring consistent behavior across form instances.
- Improved error message structure in FormPaymentTest to provide clearer feedback when a payment block is missing.
These changes aim to enhance the functionality of forms and improve logging capabilities, contributing to better maintainability and user experience.
* Update api/config/logging.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Refactor Payment Error Handling and Localization Updates
- Updated `FormPaymentTest.php` to improve code consistency by adding spaces in arrow function definitions, enhancing readability.
- Modified `useStripeElements.js` to replace hardcoded error messages with localized strings, improving user experience and maintainability.
- Enhanced various localization files (e.g., `en.json`, `fr.json`, `de.json`, etc.) to include new error messages related to payment processing, ensuring users receive clear and consistent feedback across different languages.
These changes aim to enhance the clarity of error handling in payment processes and improve the overall user experience through better localization support.
* Enhance AddFormBlock and FieldOptions with Authentication Checks
- Added an icon to indicate authentication requirements for blocks in `AddFormBlock.vue`, improving user awareness of access restrictions.
- Implemented alert notifications using `useAlert()` for unauthorized block additions and input cloning, enhancing user feedback.
- Updated `FieldOptions.vue` to conditionally render payment field options, ensuring relevant options are displayed based on the field type.
- Modified `blocks_types.json` to include an `auth_required` property for specific block types, facilitating authentication checks.
These changes aim to improve user experience by providing clear indications of authentication requirements and enhancing form functionality.
* Enhance Authentication Checks in AddFormBlock Component
- Updated `AddFormBlock.vue` to conditionally render authentication-required icons based on user authentication status, improving user awareness of access restrictions.
- Implemented additional authentication checks in the `addBlock` and `handleInputClone` functions, utilizing `useAlert()` for notifying users when login is required to add blocks or clone inputs.
- Introduced a computed property to manage the authenticated state, streamlining the authentication logic within the component.
These changes aim to enhance user experience by providing clear indications of authentication requirements and improving the functionality of the form component.
* Enhance PaymentInput Component with Disabled State Support
- Updated `PaymentInput.client.vue` to include a `disabled` prop for the card holder name and email inputs, improving form accessibility and user experience by preventing interaction when necessary.
- Modified the card options to respect the `disabled` state, ensuring consistent behavior across the payment input fields.
These changes aim to enhance the usability of the payment input component by providing better control over user interactions.
* Add Payment Condition Logic and Update Filters
- Introduced a new payment condition in `FormLogicConditionChecker.php` to handle 'paid' and 'not_paid' states, enhancing form logic capabilities.
- Added corresponding payment comparators in `open_filters.json` for both API and client, ensuring consistent validation and expected types for payment conditions.
- Updated the JavaScript logic in `FormLogicConditionChecker.js` to include the new payment condition checks, improving the overall functionality of form conditions.
These changes aim to enhance the form logic related to payment states, providing better validation and user experience in payment-related forms.
* Refactor Authentication Checks in AddFormBlock and Working Form Store
- Removed redundant authentication checks from `AddFormBlock.vue` for adding blocks and cloning inputs, streamlining the logic.
- Centralized authentication validation in `working_form.js` to ensure consistent user feedback when authentication is required for specific block types.
- Enhanced user experience by utilizing `useAlert()` for notifying users about login requirements, improving clarity and interaction.
These changes aim to simplify the authentication logic and improve user notifications regarding access restrictions in form components.
* Refactor Feature Flags and Update Payment Input Logic
- Updated `FeatureFlagsController.php` to utilize the `Cache` facade directly, improving code clarity and consistency.
- Modified `PaymentInput.client.vue` to enhance the display logic for payment previews, ensuring a better user experience by conditionally showing messages based on the state of the Stripe account.
- Removed the `STRIPE_PUBLISHABLE_KEY` from `runtimeConfig.js` to streamline the configuration and replaced it with a computed property that retrieves the key from feature flags, improving maintainability.
- Adjusted the `.env.example` file to maintain consistency in environment variable definitions.
These changes aim to enhance the clarity of feature flag management and improve the user experience in payment interactions by refining the logic and configuration handling.
* Update Stripe Configuration in Services
- Modified the `services.php` configuration file to enhance the Stripe integration by providing default values for `client_secret` and `redirect` URI. This change ensures that the application can fallback to a predefined secret and a specific callback URL, improving the robustness of the payment service setup.
These changes aim to streamline the configuration process for Stripe, ensuring that necessary values are always available for the application to function correctly.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-04-10 12:04:25 +02:00
|
|
|
class="mt-6 flex justify-center w-full"
|
|
|
|
|
>
|
|
|
|
|
<p class="text-xs text-gray-400 dark:text-gray-500 flex text-center max-w-md">
|
|
|
|
|
{{ $t('forms.payment.payment_disclaimer') }}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2023-12-09 15:47:03 +01:00
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</template>
|
|
|
|
|
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
<script setup>
|
2023-12-09 15:47:03 +01:00
|
|
|
import draggable from 'vuedraggable'
|
2023-12-24 20:19:59 +01:00
|
|
|
import OpenFormButton from './OpenFormButton.vue'
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
import CaptchaWrapper from '~/components/forms/components/CaptchaWrapper.vue'
|
2023-12-24 20:19:59 +01:00
|
|
|
import OpenFormField from './OpenFormField.vue'
|
2025-04-08 10:20:51 +02:00
|
|
|
import FormProgressbar from './FormProgressbar.vue'
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
import { useWorkingFormStore } from '~/stores/working_form'
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
formManager: { type: Object, required: true },
|
|
|
|
|
theme: { type: Object, required: true }
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const workingFormStore = useWorkingFormStore()
|
|
|
|
|
|
|
|
|
|
// Derive everything from formManager
|
|
|
|
|
const state = computed(() => props.formManager.state)
|
|
|
|
|
const form = computed(() => props.formManager.config.value)
|
|
|
|
|
const formPageIndex = computed(() => props.formManager.state.currentPage)
|
|
|
|
|
const strategy = computed(() => props.formManager.strategy.value)
|
|
|
|
|
const structure = computed(() => props.formManager.structure)
|
|
|
|
|
|
|
|
|
|
const hasPaymentBlock = computed(() => {
|
|
|
|
|
return structure.value?.currentPageHasPaymentBlock.value ?? false
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const currentFields = computed(() => {
|
|
|
|
|
return structure.value?.getPageFields(state.value.currentPage) ?? []
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const isLastPage = computed(() => {
|
|
|
|
|
const result = structure.value?.isLastPage.value ?? true
|
|
|
|
|
return result
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const currentFieldsPageBreak = computed(() =>
|
|
|
|
|
structure.value?.currentPageBreak.value
|
|
|
|
|
)
|
|
|
|
|
const previousFieldsPageBreak = computed(() =>
|
|
|
|
|
structure.value?.previousPageBreak.value
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const allowDragging = computed(() => strategy.value.admin.allowDragging)
|
|
|
|
|
const draggingNewBlock = computed(() => workingFormStore.draggingNewBlock)
|
|
|
|
|
|
|
|
|
|
const handlePreviousClick = () => {
|
|
|
|
|
props.formManager.previousPage()
|
|
|
|
|
if (import.meta.client) window.scrollTo({ top: 0, behavior: 'smooth' })
|
|
|
|
|
}
|
2025-03-25 18:35:16 +01:00
|
|
|
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
const handleNextClick = async () => {
|
|
|
|
|
await props.formManager.nextPage()
|
|
|
|
|
if (import.meta.client) window.scrollTo({ top: 0, behavior: 'smooth' })
|
|
|
|
|
}
|
2025-03-25 18:35:16 +01:00
|
|
|
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
const handleDragDropped = (data) => {
|
|
|
|
|
if (!structure.value) return
|
2025-03-25 18:35:16 +01:00
|
|
|
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
const getAbsoluteIndex = (relativeIndex) => {
|
|
|
|
|
return structure.value.getTargetDropIndex(relativeIndex, state.value.currentPage)
|
|
|
|
|
}
|
2025-03-25 18:35:16 +01:00
|
|
|
|
Refactor form rendering (#747)
* Update Dependencies and Refactor Form Components
- Upgraded various Sentry-related packages in `package-lock.json` to version 9.15.0, ensuring compatibility with the latest features and improvements.
- Refactored `FormProgressbar.vue` to utilize `config` for color and visibility settings instead of `form`, enhancing flexibility in form management.
- Removed the `FormTimer.vue` component as it was deemed unnecessary, streamlining the form component structure.
- Updated `OpenCompleteForm.vue` and `OpenForm.vue` to integrate `formManager`, improving the overall management of form states and properties.
- Enhanced `UrlFormPrefill.vue` to utilize `formManager` for better handling of pre-filled URL generation.
These changes aim to improve the maintainability and performance of the form components while ensuring they leverage the latest dependency updates.
* Refactor Form Components to Utilize Composables and Improve State Management
- Updated `FormProgressbar.vue` to access `config.value` and `data.value` for better reactivity.
- Refactored `OpenCompleteForm.vue` to use `useFormManager` for managing form state, enhancing clarity and maintainability.
- Modified `OpenForm.vue` to leverage `structure.value` and `config.value`, improving the handling of form properties and structure.
- Enhanced `UrlFormPrefill.vue` to initialize `useFormManager` within the setup function, streamlining form management.
- Updated `FormManager.js` and `FormStructureService.js` to improve validation logic and state management, ensuring better performance and reliability.
These changes aim to enhance the overall maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Refactor Form Components to Enhance State Management and Structure
- Updated `FormProgressbar.vue` to utilize `props.formManager?.config` and `structureService` for improved reactivity and data handling.
- Refactored `OpenCompleteForm.vue` to initialize `formManager` outside of `onMounted`, enhancing SSR compatibility and clarity in form state management.
- Modified `OpenForm.vue` to leverage `formManager.form` for data binding, streamlining the handling of form properties.
- Updated `OpenFormField.vue` to utilize `formManager` directly for field logic checks, improving maintainability and consistency.
- Removed obsolete `FormManager.js`, `FormInitializationService.js`, `FormPaymentService.js`, `FormStructureService.js`, `FormSubmissionService.js`, and `FormTimerService.js` files to simplify the codebase and reduce complexity.
These changes aim to enhance the maintainability and performance of the form components by leveraging composables for state management and improving the reactivity of form properties.
* Enhance OpenCompleteForm and OpenForm Components with Auto-Submit and State Management Improvements
- Updated `OpenCompleteForm.vue` to include an auto-submit feature that triggers form submission when the `auto_submit` parameter is present in the URL. This improves user experience by streamlining the submission process.
- Refactored `OpenForm.vue` to remove the loader display logic, simplifying the component structure and enhancing clarity.
- Enhanced `pendingSubmission.js` to include a `clear` method for better management of pending submissions.
- Modified `Form.js` to ensure that the submission payload correctly merges additional data, improving the robustness of form submissions.
- Updated `useFormInitialization.js` to handle pending submissions and URL parameters more effectively, ensuring a smoother user experience.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management and user interaction capabilities.
* Enhance Partial Submission Functionality and Sync Mechanism
- Updated `usePartialSubmission.js` to improve the synchronization mechanism by increasing the debounce time from 1 second to 2 seconds, reducing the frequency of sync operations.
- Introduced a new `syncImmediately` function to allow immediate synchronization during critical events such as page unload, enhancing data reliability.
- Refactored the `syncToServer` function to handle computed ref patterns for form data more effectively, ensuring accurate data submission.
- Modified event handlers to utilize the new immediate sync functionality, improving responsiveness during visibility changes and window blur events.
- Enhanced the `stopSync` function to perform a final sync before stopping, ensuring no data is lost during component unmounting.
These changes aim to improve the reliability and performance of partial submissions, ensuring that user data is consistently synchronized with the server during critical interactions.
* Refactor OpenFormField Component to Use Composition API and Enhance Field Logic
- Converted `OpenFormField.vue` to utilize the Composition API with `<script setup>`, improving readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored computed properties and methods to leverage the new setup structure, enhancing performance and organization.
- Updated `FormFieldEdit.vue` to ensure the structure service is used for setting the page for the selected field, improving navigation consistency.
- Enhanced `useFormStructure.js` with additional validation for field indices and introduced a new `setPageForField` method to manage page navigation more effectively.
- Modified `working_form.js` to streamline the management of the current page index and ensure proper integration with the structure service.
These changes aim to improve the overall structure and functionality of the form components, enhancing user experience and maintainability.
* Enhance Captcha Handling and Refactor OpenForm Component
- Added error handling for resetting hCaptcha and reCAPTCHA in `HCaptchaV2.vue` and `RecaptchaV2.vue`, improving user experience by providing fallback mechanisms when the reset fails.
- Refactored `OpenForm.vue` to replace the `CaptchaInput` component with `CaptchaWrapper`, streamlining the captcha integration and enhancing maintainability.
- Removed obsolete captcha registration logic from `useFormManager.js` and `useFormValidation.js`, simplifying the form management process and improving code clarity.
These changes aim to improve the reliability and user experience of captcha handling within the form components, ensuring smoother interactions and better error management.
* Refactor PaymentInput Component to Enhance Stripe Elements Integration
- Replaced the `useStripeElements` composable with a new `createStripeElements` function, allowing for lazy initialization of Stripe elements based on provided props.
- Introduced a local instance for Stripe elements, improving fallback handling when payment data is not available.
- Updated computed properties to ensure proper access to Stripe state and methods, enhancing reliability in payment processing.
- Modified the `CaptchaWrapper` component to remove the dark mode prop, simplifying its interface.
- Refactored `OpenCompleteForm`, `OpenForm`, and `OpenFormField` components to derive theme and dark mode settings directly from `formManager`, improving consistency across form components.
These changes aim to streamline the integration of Stripe elements, enhance maintainability, and improve the overall user experience in payment processing within the form components.
* Enhance Payment Input and Form Components for Improved Stripe Integration
- Updated the `PaymentInput.client.vue` component to provide more informative messages during payment preview, including detailed error messages for missing configurations.
- Refactored the handling of Stripe elements to ensure proper initialization and state management, improving reliability in payment processing.
- Enhanced the `OpenCompleteForm.vue` and `OpenFormField.vue` components to streamline payment data retrieval and submission processes.
- Improved error handling in `OpenCompleteForm.vue` to provide clearer feedback on submission issues.
- Refactored `useStripeElements.js` to support lazy initialization of Stripe elements with an optional account ID, enhancing flexibility in payment configurations.
These changes aim to improve the user experience during payment processing by providing clearer feedback and ensuring robust integration with Stripe elements.
* Refactor FormPaymentController and Update Payment Intent Route
- Updated the `FormPaymentController` to utilize `CreatePaymentIntentRequest` for improved request validation and handling.
- Changed the `createIntent` method to accept a POST request instead of GET, aligning with RESTful practices for creating resources.
- Enhanced the payment intent creation logic to use a description from the payment block if available, improving clarity in payment processing.
- Modified the `useFormPayment` composable to reflect the change to a POST request, ensuring proper API interaction and logging.
These changes aim to enhance the payment processing flow by improving request handling and aligning with best practices for API design.
* Refactor UrlFormPrefill Component to Utilize Composition API
- Converted `UrlFormPrefill.vue` to use the Composition API with `<script setup>`, enhancing readability and maintainability.
- Defined props using `defineProps` for better type safety and clarity.
- Refactored the initialization of `formManager` to streamline setup and improve logging during form management.
- Updated the URL generation method to utilize reactive references, ensuring better state management and performance.
- Removed obsolete props and methods, simplifying the component structure.
These changes aim to improve the overall structure and functionality of the `UrlFormPrefill` component, enhancing user experience and maintainability.
* Enhance OpenCompleteForm and FormManager with Improved State Management and Debugging
- Added `workingFormStore` to `OpenCompleteForm.vue` for better integration with the working form state.
- Introduced a watcher in `OpenCompleteForm.vue` to share the structure service with the working form store when in admin edit context, enhancing form management capabilities.
- Updated `useFormManager.js` to include a watcher for `currentPage`, improving debugging by logging page changes.
- Modified payment processing logic in `useFormManager.js` to conditionally skip payment validation in non-LIVE modes, enhancing flexibility during development.
- Refactored `useFormStructure.js` to eliminate unnecessary calls to `toValue`, improving performance and clarity in state management.
- Adjusted `useFormValidation.js` to directly access `managerState.currentPage`, streamlining error handling during form validation.
These changes aim to improve the overall functionality and maintainability of the form components by enhancing state management, debugging capabilities, and flexibility in payment processing.
* Refactor Form Components for Improved Logic and State Management
- Updated `OpenForm.vue` to simplify the conditional rendering of the previous button by removing the loading state check, enhancing clarity in button visibility logic.
- Refactored `useFormInitialization.js` to streamline the `updateSpecialFields` function by removing the fields parameter and directly iterating over `formConfig.value.properties`, improving code readability and maintainability.
- Modified `useFormManager.js` to eliminate the passing of fields in the initialization options, simplifying the initialization process.
- Enhanced `useFormPayment.js` to check for existing payment intent IDs directly in the form data, improving the payment processing logic and reducing redundant checks.
- Updated `useFormStructure.js` to include a computed property for `currentPage`, enhancing the state management of the form structure.
- Refactored `working_form.js` to replace the structure service's current page access, improving the integration with the form state.
These changes aim to enhance the overall functionality and maintainability of the form components by improving state management and simplifying logic across various form-related files.
* Refactor Form Components and Improve Submission Logic
- Updated `OpenCompleteForm.vue` to enhance the submission logic by directly using `submissionId` from the variable instead of the route query, improving clarity and reducing dependency on route parameters.
- Modified `triggerSubmit` function in `OpenCompleteForm.vue` to streamline the handling of submission results, ensuring that `submittedData` is set directly from the result and simplifying the conditional checks for `submission_id` and `is_first_submission`.
- Removed the `pendingSubmission.js` file as it was no longer needed, consolidating the submission handling logic within the relevant components and composables.
- Enhanced `usePartialSubmission.js` to improve the management of submission hashes and ensure that the service integrates seamlessly with the new structure, prioritizing local storage for hash retrieval.
- Updated `useFormInitialization.js` to improve error handling and ensure that the form resets correctly when loading submissions fails, enhancing user experience.
- Refactored `useFormManager.js` to instantiate the new `usePendingSubmission` service, ensuring that local storage handling is properly integrated into the form management process.
These changes aim to improve the overall functionality, maintainability, and user experience of the form components by streamlining submission logic and enhancing state management.
* Refactor FormProgressbar Component for Improved Logic and Clarity
- Updated the `FormProgressbar.vue` component to simplify the condition for displaying the progress bar by directly using the `showProgressBar` computed property instead of accessing it through the `config` object.
- Refactored the computed properties to ensure they directly reference the necessary values from `formManager`, enhancing clarity and maintainability.
- Modified the logic for calculating progress to utilize `config.value?.properties` instead of `structureService`, streamlining the progress calculation process.
These changes aim to enhance the overall functionality and maintainability of the `FormProgressbar` component by improving the clarity of the progress display logic and ensuring accurate progress calculations.
* Refactor OpenCompleteForm and Index Page for Improved Logic and Clarity
- Updated `OpenCompleteForm.vue` to remove unnecessary margin from the password protected message, enhancing the visual layout.
- Added `addPasswordError` function to `defineExpose` in `OpenCompleteForm.vue`, allowing better error handling for password validation.
- Refactored the usage of the translation function in `index.vue` to destructure `t` from `useI18n`, improving code clarity and consistency.
These changes aim to enhance the overall functionality and maintainability of the form components by streamlining error handling and improving the clarity of the code structure.
* Enhance Form Submission Logic and Validation Rules
- Updated `PublicFormController.php` to dispatch the job for handling form submissions asynchronously, improving performance and responsiveness.
- Modified `AnswerFormRequest.php` to add validation rules for `completion_time` and make `submission_id` nullable, enhancing data integrity and flexibility.
- Added debugging output in `StoreFormSubmissionJob.php` to log form data and completion time, aiding in troubleshooting and monitoring.
These changes aim to improve the overall functionality and maintainability of the form submission process by optimizing job handling and enhancing validation mechanisms.
* Update ESLint Configuration and Add Vue Plugin
- Modified `.eslintrc.cjs` to ensure proper formatting by removing an unnecessary trailing comma.
- Updated `package.json` and `package-lock.json` to include `eslint-plugin-vue` version 10.1.0, enhancing linting capabilities for Vue components.
These changes aim to improve code quality and maintainability by ensuring consistent linting rules and support for Vue-specific linting features.
* Enhance User Management Tests and Form Components
- Updated `UserManagementTest.php` to include validation for Google reCAPTCHA by adding the `g-recaptcha-response` parameter in registration tests, ensuring comprehensive coverage of user registration scenarios.
- Modified `FormPaymentTest.php` to change the HTTP method from GET to POST for creating payment intents, aligning with RESTful practices and improving the accuracy of test cases.
- Enhanced `FlatSelectInput.vue` to support slot-based rendering for selected options and options, improving flexibility in how options are displayed and selected.
- Refactored `OpenCompleteForm.vue` to correct indentation in the form submission logic, enhancing code readability.
- Updated `FormSubmissionSettings.vue` to replace the `select-input` component with `flat-select-input`, improving consistency in form component usage.
- Enhanced `useFormManager.js` to add logging for form submissions and handle postMessage communication for iframe integration, improving debugging and integration capabilities.
These changes aim to improve the robustness of the testing suite and enhance the functionality and maintainability of form components by ensuring proper validation and consistent component usage.
* Refactor ESLint Configuration and Improve Error Handling in Components
- Deleted the obsolete `.eslintrc.cjs` file to streamline ESLint configuration management.
- Updated `eslint.config.cjs` to include ignores for `.nuxt/**`, `node_modules/**`, and `dist/**`, enhancing linting efficiency.
- Refactored error handling in various components (e.g., `DateInput.vue`, `FlatSelectInput.vue`, `CaptchaInput.vue`, etc.) by removing the error variable in catch blocks, simplifying the code and maintaining functionality.
- Improved the logic in `FormBlockLogicEditor.vue` to check for non-empty logic objects, enhancing validation accuracy.
These changes aim to improve code quality and maintainability by optimizing ESLint configurations and enhancing error handling across components.
* Fix Logic in useFormInitialization for Matrix Field Prefill Handling
- Updated the `updateSpecialFields` function in `useFormInitialization.js` to correct the logic for handling matrix fields. The condition now checks the form directly instead of using a separate `formData` parameter, ensuring that prefill data is applied correctly when the field is empty.
These changes aim to enhance the accuracy of form initialization by ensuring proper handling of matrix fields during the form setup process.
* Add findFirstPageWithError function to useFormValidation for improved error handling
- Introduced the `findFirstPageWithError` function in `useFormValidation.js` to identify the index of the first page containing validation errors. This function checks for existing errors and iterates through the nested array of field groups to determine if any page has errors, returning the appropriate index or -1 if no errors are found.
These changes aim to enhance the form validation process by providing a clear mechanism to locate pages with validation issues, improving user experience during form submissions.
* Enhance OpenCompleteForm Logic and Add Confetti Feature
- Updated `OpenCompleteForm.vue` to improve conditional rendering by changing `v-if` to `v-else-if` for better clarity in form submission states.
- Introduced a new computed property `shouldDisplayForm` to centralize the logic for determining form visibility based on submission status and admin controls.
- Modified `useFormManager.js` to include a confetti effect upon successful form submission, enhancing user engagement during the submission process.
These changes aim to improve the user experience by refining form visibility logic and adding a celebratory feature upon successful submissions.
* Refactor Form Submission Job and Storage File Logic
- Updated `StoreFormSubmissionJob.php` to streamline the constructor by combining the constructor body into a single line for improved readability.
- Removed debugging output in `StoreFormSubmissionJob.php` to clean up the code and enhance performance.
- Simplified the constructor in `StorageFile.php` by consolidating it into a single line, improving code clarity.
- Enhanced the logic in `StorageFile.php` to utilize a file name parser for checking file existence, ensuring more accurate file handling.
These changes aim to improve code readability and maintainability by simplifying constructors and enhancing file handling logic.
* Refactor Constructors in StoreFormSubmissionJob and StorageFile
- Updated the constructors in `StoreFormSubmissionJob.php` and `StorageFile.php` to include an explicit body, enhancing code clarity and consistency in constructor definitions.
- Improved readability by ensuring a uniform structure across class constructors.
These changes aim to improve code maintainability and readability by standardizing the constructor format in the affected classes.
---------
Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-05-07 17:15:56 +02:00
|
|
|
if (data.added) {
|
|
|
|
|
const targetIndex = getAbsoluteIndex(data.added.newIndex)
|
|
|
|
|
workingFormStore.addBlock(data.added.element, targetIndex, false)
|
|
|
|
|
}
|
|
|
|
|
if (data.moved) {
|
|
|
|
|
const oldTargetIndex = getAbsoluteIndex(data.moved.oldIndex)
|
|
|
|
|
const newTargetIndex = getAbsoluteIndex(data.moved.newIndex)
|
|
|
|
|
workingFormStore.moveField(oldTargetIndex, newTargetIndex)
|
2023-12-09 15:47:03 +01:00
|
|
|
}
|
|
|
|
|
}
|
2025-05-19 14:53:30 +02:00
|
|
|
|
|
|
|
|
const isProcessing = computed(() => props.formManager.state.isProcessing)
|
2023-12-09 15:47:03 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang='scss' scoped>
|
|
|
|
|
.ghost-item {
|
|
|
|
|
@apply bg-blue-100 dark:bg-blue-900 rounded-md;
|
|
|
|
|
}
|
|
|
|
|
</style>
|