Commit Graph

27 Commits

Author SHA1 Message Date
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 20405ee606
Send mobile editor email (#634)
Co-authored-by: Julien Nahum <julien@nahum.net>
2024-12-12 11:19:09 +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
Chirag Chhatrala daca69267b
Form Translation (#616)
* Form Translation

* Support for other languages

* Support locale for datepicker

* Apply translation on select input

* Apply translation on select input

* Improve translation

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-12-04 18:32:14 +01:00
Julien Nahum 6cf1cd663a Refactor AnswerFormRequest to enhance option matching logic
- Improved the option matching logic in AnswerFormRequest by ensuring both 'id' and 'name' are checked for validity before comparison.
- Simplified the handling of selection fields and single select values to return the original value if no match is found.

This change aims to increase the robustness of data handling in form requests.
2024-11-29 15:17:49 +01:00
Chirag Chhatrala 13c40f6e54
Support for Rich Text Input (#630)
* Support for Rich Text Input

* rich text support for prefilled

* apply Purify for rich_text

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-11-28 16:12:24 +01:00
Julien Nahum e2c6af69e6 [ESC-389]form-requires-to-answer 2024-11-28 10:22:33 +01:00
Chirag Chhatrala ab83aa166c
Matrix Improvements (#606)
* Support disable on matrix

* fix checkbox and radio icon

* Use Nuxt UI toggle

* Can set max_char_limit null

* fix action icon design

* Support for URL prefill for Matrix

* Apply theme color on toggle

* Set --form-color as style variable and use it

* Set default value for form-color

* fix formatting

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-11-20 17:06:11 +01:00
Chirag Chhatrala 62e980abae
Right to left mode (#611)
* Right to left mode

* Fix label

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-11-20 15:29:08 +01:00
Chirag Chhatrala 2c8f7d5d54
on fetch submission data display error if there (#608)
Co-authored-by: Julien Nahum <julien@nahum.net>
2024-11-13 09:48:28 +01:00
Julien Nahum ef12c82fe5 Added parseAsText to mention parser. Fix multiple email recipients 2024-11-06 17:48:10 +01: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
Favour Olayinka ef404e1d1e
apply first submission modal changes (#584)
* apply first submission modal changes

* Apply changes

* fix submiussions url

* fix lint

* Fix nuxt versions issues

* Add fixed version of nitropack

* Attempt to fix build

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-10-21 17:41:20 +02:00
Favour Olayinka dea8fe5741
106a6 integration performance issues (#581)
* apply performance fixes

* fix integration

* Update client/components/open/forms/components/FirstSubmissionModal.vue

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix unique cache for forms

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-10-01 12:42:03 +02:00
Julien Nahum 85098c2d34 Fix form stats 2024-09-30 15:13:40 +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
Favour Olayinka 5ab3477e0a
104a6 utm tracking in db (#578)
* utm tracking in db

* fix array key bug

* fix utm form

* fix import
2024-09-20 11:47:12 +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
Favour Olayinka a057045ef6
utm tracking in db (#574)
* utm tracking in db

* fix array key bug
2024-09-18 18:50:04 +02:00
Chirag Chhatrala da0ea04475
Dynamic OauthDriver scope (#544)
* Dynamic OauthDriver scope

* support migration for mysql

* Refactor default scopes for integrations

* Small UI changes

* fix flet select tooltip

* fix linter

* Fix google token size in DB

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-08-29 13:28:02 +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
Chirag Chhatrala 8e777ecca6
Form Templates for self hosted (#546)
Co-authored-by: Julien Nahum <julien@nahum.net>
2024-08-29 11:08:09 +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