Commit Graph

21 Commits

Author SHA1 Message Date
Julien Nahum f350ed778c Refactor form submission processing with new FormSubmissionProcessor
- Introduce FormSubmissionProcessor service to handle synchronous/asynchronous form submission logic
- Modify PublicFormController to use new processor for submission and redirect handling
- Update StoreFormSubmissionJob to support processed data retrieval
- Add comprehensive test suite for FormSubmissionProcessor
- Improve handling of generated fields and redirect URL processing
2025-02-01 22:52:20 +01:00
Julien Nahum 747b41d0a6 Add error logging for integration failures in AbstractIntegrationHandler
- Introduced logging of integration failures to capture detailed error information.
- Enhanced error handling by logging the form ID and integration ID along with the exception data.

These changes improve the observability of integration processes, aiding in debugging and monitoring.
2025-01-14 14:34:03 +01:00
Julien Nahum e3fd709326 Refactor Email Integration Handling
- Removed the AbstractEmailIntegrationHandler class to streamline email integration logic.
- Updated EmailIntegration class to extend AbstractIntegrationHandler instead of the removed class.
- Modified FormEmailNotification to handle mailer configuration internally, eliminating the need to pass the mailer as a parameter.

These changes enhance the clarity and maintainability of the email integration process by consolidating configuration logic and reducing class dependencies.
2025-01-14 13:29:09 +01:00
Chirag Chhatrala cc62f614e4
Enhance Form Submission Export Functionality (#657)
* Enhance Form Submission Export Functionality

* Validate new param 'columns'

* Form submission export request as seprate class with validation

* Test case for export

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2025-01-07 15:04:02 +01:00
Chirag Chhatrala 3d9bc60ca1
Evaluate custom validation rules first (#655) 2024-12-30 11:00:10 +01:00
Chirag Chhatrala d7ce8536c8
Add reCAPTCHA support and update captcha provider handling (#647)
* Add reCAPTCHA support and update captcha provider handling

- Introduced reCAPTCHA as an additional captcha provider alongside hCaptcha.
- Updated form request validation to handle different captcha providers based on user selection.
- Added a new validation rule for reCAPTCHA.
- Modified the forms model to include a 'captcha_provider' field.
- Created a migration to add the 'captcha_provider' column to the forms table.
- Updated frontend components to support dynamic rendering of captcha based on the selected provider.
- Enhanced tests to cover scenarios for both hCaptcha and reCAPTCHA.

These changes improve the flexibility of captcha options available to users, enhancing form security and user experience.

* fix pint

* change comment text

* Refactor captcha implementation and integrate new captcha components

- Removed the old RecaptchaV2 component and replaced it with a new implementation that supports both reCAPTCHA and hCaptcha through a unified CaptchaInput component.
- Updated the OpenForm component to utilize the new CaptchaInput for dynamic captcha rendering based on user-selected provider.
- Cleaned up the package.json by removing the deprecated @hcaptcha/vue3-hcaptcha dependency.
- Enhanced form initialization to set a default captcha provider.
- Improved error handling and cleanup for both reCAPTCHA and hCaptcha scripts.

These changes streamline captcha integration, improve maintainability, and enhance user experience by providing a more flexible captcha solution.

* Refactor captcha error messages and localization support

* Refactor registration process to integrate reCAPTCHA

- Replaced hCaptcha implementation with reCAPTCHA in RegisterController and related test cases.
- Updated validation rules to utilize g-recaptcha-response instead of h-captcha-response.
- Modified RegisterForm component to support reCAPTCHA, including changes to the form data structure and component references.
- Enhanced test cases to reflect the new reCAPTCHA integration, ensuring proper validation and response handling.

These changes improve security and user experience during the registration process by adopting a more widely used captcha solution.

* Fix reCAPTCHA configuration and update RegisterForm styling

- Corrected the configuration key for reCAPTCHA in RegisterController from 'services.recaptcha.secret_key' to 'services.re_captcha.secret_key'.
- Updated the styling of the Captcha input section in RegisterForm.vue to improve layout consistency.

These changes ensure proper reCAPTCHA functionality and enhance the user interface during the registration process.

* Fix reCAPTCHA configuration in RegisterTest to use the correct key format

- Updated the configuration key for reCAPTCHA in RegisterTest from 'services.recaptcha.secret_key' to 'services.re_captcha.secret_key' to ensure proper functionality during tests.

This change aligns the test setup with the recent updates in the reCAPTCHA integration, improving the accuracy of the registration process tests.

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-12-18 16:35:09 +01:00
Chirag Chhatrala 7365479c83
Email spam security (#641)
* Add hCaptcha on register page

* register page captcha test cases

* Refactor integration validation rules to include form context

- Updated the `getValidationRules` method in various integration handlers (Discord, Email, Google Sheets, Slack, Webhook, Zapier) to accept an optional `Form` parameter, allowing for context-aware validation.
- Enhanced the `EmailIntegration` handler to enforce restrictions based on user plans, ensuring free users can only create one email integration per form and can only send to a single email address.
- Added a new test suite for `EmailIntegration` to validate the new restrictions and ensure proper functionality for both free and pro users.
- Introduced loading state management in the `IntegrationModal` component to improve user experience during save operations.

These changes improve the flexibility and user experience of form integrations, particularly for email handling.

* for self-hosted ignore emil validation for spam

* fix pint

* ignore register throttle for testing env

* support new migration for mysql also

* Register page captcha enable if captcha key set

* fix test case

* fix test case

* fix test case

* fix pint

* Refactor RegisterController middleware and update TestCase setup

- Removed environment check for throttling middleware in RegisterController, ensuring consistent rate limiting for the registration endpoint.
- Updated TestCase to disable throttle middleware during tests, allowing for more flexible testing scenarios without rate limiting interference.

* Enhance hCaptcha integration in tests and configuration

- Added hCaptcha site and secret keys to phpunit.xml for testing purposes.
- Updated RegisterTest to configure hCaptcha secret key dynamically, ensuring proper token validation in production environment.

These changes improve the testing setup for hCaptcha, facilitating more accurate simulation of production conditions.

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-12-18 13:16:27 +01:00
Chirag Chhatrala 28019fc7a0
Implement regex validation conditions in form logic (#645)
* Implement regex validation conditions in form logic

- Added support for 'matches_regex' and 'does_not_match_regex' conditions in FormPropertyLogicRule and FormLogicConditionChecker.
- Updated validation logic to handle regex patterns, including error handling for invalid patterns.
- Enhanced tests to cover scenarios for successful and failed regex validation, ensuring proper feedback for form submissions.
- Updated JSON schema to include new regex condition types.

These changes improve the flexibility of form validation by allowing regex-based conditions, enhancing user experience through more robust validation mechanisms.

* update resource filters

* Remove ray

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-12-16 17:17:29 +01:00
Chirag Chhatrala ea4cd85eae
Enhance redirect URL handling and MentionParser functionality (#639)
- Updated the `redirect_url` validation in `UserFormRequest` to accept strings instead of just max length.
- Modified `MentionParser` to include a `urlFriendlyOutput` method, allowing for URL encoding of special characters in parsed values.
- Adjusted the `PublicFormController` to utilize the new `urlFriendlyOutput` method for redirect URLs.
- Created a migration to change the `redirect_url` field type in the database from string to text, accommodating longer URLs.
- Added tests to ensure proper handling of long redirect URLs and the functionality of the new URL-friendly output feature in `MentionParser`.

This update improves the flexibility and robustness of form handling and URL processing.
2024-12-10 12:26:01 +01:00
Julien Nahum e2c6af69e6 [ESC-389]form-requires-to-answer 2024-11-28 10:22:33 +01:00
Chirag Chhatrala 08837e6a29
Fix email notification reply to (#603) 2024-10-28 09:17:01 +00:00
Chirag Chhatrala dad5c825b1
Apply Mentions everywhere (#595)
* variables and mentions

* fix lint

* add missing changes

* fix tests

* update quilly, fix bugs

* fix lint

* apply fixes

* apply fixes

* Fix MentionParser

* Apply Mentions everywhere

* Fix MentionParserTest

* Small refactoring

* Fixing quill import issues

* Polished email integration, added customer sender mail

* Add missing changes

* improve migration command

---------

Co-authored-by: Frank <csskfaves@gmail.com>
Co-authored-by: Julien Nahum <julien@nahum.net>
2024-10-22 10:34:29 +02:00
Julien Nahum 5346054584 Fix tests 2024-09-30 16:47:10 +02:00
Chirag Chhatrala 504c7a0f2f
Custom SMTP Settings (#561)
* Custom SMTP Settings

* Fix lint

* Custom SMTP add in Pricing plan

* Allow reset email settings

* improve custom SMTP using seprate abstract class

* test case for custom SMTP

* fix test case

* UI improvement

* add CASHIER_KEY in phpunit for testcase

* Attempt to fix tests

* Run pint and attempt to fix cache tests

* Fix user management tests

* Fix code linters

* Merged main & fix linting

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-09-24 12:16:20 +02:00
Chirag Chhatrala d6181cd249
Form editor v2 (#579)
* Form editor v2

* fix template test

* setFormDefaults when save

* fix form cleaning dark mode

* improvements on open sidebar

* UI polish

* Fix change type button

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-09-23 20:02:38 +02:00
Chirag Chhatrala ceb0648262
Better Form Stats (#567)
* Better Form Stats

* fix lint

* submission timer store in localstorage

* Update test case for stats

* remove extra code

* fix form stats

* on restart remove timer

* fix resetTimer function name

* Improve form timer

* Fix timer after form validation error + polish UI

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-09-18 19:20:52 +02:00
Chirag Chhatrala 89513e3b4a
Form analytics now paid feature (#547)
Co-authored-by: Julien Nahum <julien@nahum.net>
2024-08-29 11:14:49 +02:00
Julien Nahum 6736e15074 Fix custom-domains feature flag 2024-08-28 18:00:11 +02:00
Julien Nahum 2503595786 Reduce docker api image size, fix issues 2024-08-28 15:20:39 +02:00
Julien Nahum 79d3dd7888
Feature flags (#543)
* Re-organize a bit controllers

* Added the featureflagcontroller

* Implement feature flags in the front-end

* Clean env files

* Clean console.log messages

* Fix feature flag test
2024-08-27 16:49:43 +02:00
Julien Nahum 5bd1dda504
Separated laravel app to its own folder (#540) 2024-08-26 18:24:56 +02:00