Commit Graph

62 Commits

Author SHA1 Message Date
Julien Nahum 3dd3147b19 Enhance ESLint Configuration and Improve Code Consistency
- Updated ESLint configuration in `.eslintrc.cjs` to enforce error handling for unused variables, allowing for better code quality and maintainability.
- Added `clone-deep` import in `OpenForm.vue` to facilitate deep cloning of objects, enhancing functionality.
- Refactored variable destructuring in `ColumnCondition.vue` and `useAlert.js` to improve readability by using underscore for ignored parameters.
- Modified `pinia-history.js` to use underscore for unused parameters in the `get` and `set` functions, aligning with the new ESLint rules.

These changes aim to improve code quality, maintainability, and consistency across the codebase.
2025-03-27 11:07:39 +01:00
Julien Nahum 0d9c658638 Enhance Error Handling and Validation Feedback in Form Components
- Updated error handling in `EditSubmissionModal.vue`, `OpenCompleteForm.vue`, and `OpenForm.vue` to utilize a new `formValidationError` method for improved user feedback on validation issues.
- Introduced `formValidationError` function in `useAlert.js` to format and display validation errors more effectively, including detailed error messages for multiple fields.
- These changes aim to provide clearer and more actionable feedback to users when form submissions fail due to validation errors, enhancing the overall user experience.
2025-03-26 20:05:23 +01:00
Chirag Chhatrala 2c746437c9
Re-login modal (#717)
* Implement quick login/register flow with global event handling

- Add QuickRegister component with improved modal management
- Integrate quick login/register with app store state
- Implement custom event handling for login/registration flow
- Update OAuth callback to support quick login in popup windows
- Refactor authentication-related components to use global events

* Refactor authentication flow with centralized useAuth composable

- Create new useAuth composable to centralize login, registration, and social login logic
- Simplify authentication methods in LoginForm and RegisterForm
- Add event-based login/registration flow with quick login support
- Remove redundant API calls and consolidate authentication processes
- Improve error handling and analytics tracking for authentication events

* Enhance QuickRegister and RegisterForm components with unauthorized error handling

- Add closeable functionality to modals based on unauthorized error state
- Implement logout button in QuickRegister for unauthorized users
- Reset unauthorized error state on component unmount
- Update styling for "OR" text in RegisterForm for consistency
- Set unauthorized error flag in app store upon 401 response in API calls

* Refactor Authentication Flow and Remove Unused Callback Views

- Deleted unused callback views for Notion and OAuth to streamline the codebase.
- Updated QuickRegister and LoginForm components to remove the after-login event emission, replacing it with a window message system for better communication between components.
- Enhanced the RegisterForm and other components to utilize the new window message system for handling login completion, improving reliability and maintainability.
- Added a verifyAuthentication method in the useAuth composable to ensure user data is loaded correctly after social logins, including retry logic for fetching user data.

These changes aim to simplify the authentication process and improve the overall user experience by ensuring a more robust handling of login events.

* Add eslint-disable comment to useWindowMessage composable for linting control

* Refactor QuickRegister.vue for improved template structure and clarity

- Adjusted the rendering of horizontal dividers and the "or" text for better semantic HTML.
- Added a compact-header prop to the modal for enhanced layout control.

These changes aim to enhance the readability and maintainability of the QuickRegister component.

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-25 10:41:11 +01:00
Chirag Chhatrala aa5c1acf3a
Decouple title from title block (#696)
* Decouple title from title block

* fix lint

* remove dry run for FormTitleMigration

* Skip form title migration for forms with hidden titles

* Refactor AI Form Generation with Dedicated Prompt Services

- Extract AI form generation logic from GenerateTemplate command into dedicated prompt service classes
- Update GenerateAiForm job to use new prompt generation services
- Improve GptCompleter with more robust error handling and token tracking
- Add error field to AiFormCompletion model for better error logging
- Simplify command signature from 'ai:make-form-template' to 'form:generate'

* Consolidate Template Metadata Generation with Unified Prompt Service

- Create GenerateTemplateMetadataPrompt to centralize template metadata generation
- Update GenerateTemplate command to use new consolidated metadata generation approach
- Enhance GptCompleter to support strict JSON schema validation
- Increase form prompt max length to support more complex form descriptions
- Refactor form generation to simplify metadata extraction and processing

* Implement Form Mode Strategy for Flexible Form Rendering

- Introduce FormModeStrategy to centralize form rendering logic
- Add support for different form modes: LIVE, PREVIEW, TEST, EDIT, PREFILL
- Refactor components to use mode-based rendering strategy
- Remove legacy boolean props like adminPreview and creating
- Enhance form component flexibility and reusability

* Refine Form Mode Strategy Display Behavior

- Update FormModeStrategy to hide hidden fields in PREVIEW mode
- Add FormMode getter in UrlFormPrefill component for mode-specific rendering
- Clarify mode-specific validation and display logic in form strategies

* Enhance Form Template Generation with Advanced Field Options

- Update GenerateTemplate command to use front_url for template URL output
- Expand GenerateFormPrompt with comprehensive field configuration options
- Add support for advanced field types: date with time, toggle switches, radio/checkbox selections
- Introduce field width configuration and HTML formatting for text elements
- Re-enable select, multi-select, and matrix field type definitions with enhanced configurations

* Remove Deprecated Template Metadata Generation Services

- Delete multiple AI prompt services related to template metadata generation
- Simplify GenerateTemplate command to use default values instead of complex metadata generation
- Remove GenerateTemplateMetadataPrompt and related classes like GenerateTemplateDescriptionPrompt, GenerateTemplateImageKeywordsPrompt, etc.
- Update form template generation to use basic fallback metadata generation approach

* Restore GenerateTemplateMetadataPrompt for Comprehensive Template Generation

- Reintroduce GenerateTemplateMetadataPrompt to replace default metadata generation
- Update GenerateTemplate command to use consolidated metadata generation approach
- Extract detailed metadata components including title, description, industries, and image search query
- Improve template generation with more dynamic and AI-generated metadata

* Refactor Template Preview Section Layout

- Remove unnecessary nested div in template preview section
- Simplify HTML structure for the template preview component
- Maintain existing styling and functionality while improving code readability

* Refactor Constructor and Code Formatting in AI Form Generation and Prompt Classes

- Updated the constructor in GenerateAiForm.php to use a block structure for improved readability and consistency.
- Added a blank line in the Prompt.php file to enhance code formatting and maintain consistency with PHP coding standards.
- Modified the migration file to use a more concise class declaration syntax, improving clarity.

These changes aim to enhance code readability and maintainability across the affected files.

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-21 16:59:18 +01:00
Chirag Chhatrala 37a10cbdfa
Add regex matching filters to open_filters.json (#722)
* Add regex matching filters to open_filters.json

- Introduce new regex-based filters: matches_regex and does_not_match_regex
- Add support for string-based regex matching in both API and client filter configurations
- Update filter schemas to include new regex filter options with expected string type

* Add barcode comparators and regex filters to open_filters.json and validatePropertiesLogic.js

- Introduce new barcode comparators: equals, does_not_equal, contains, does_not_contain, starts_with, ends_with, is_empty, is_not_empty, matches_regex, does_not_match_regex, content_length_equals, content_length_does_not_equal, content_length_greater_than, content_length_greater_than_or_equal_to, content_length_less_than, content_length_less_than_or_equal_to.
- Add regex matching filters: matches_regex and does_not_match_regex to open_filters.json.
- Remove console log statements from validatePropertiesLogic.js and FormPropertyLogicRule.js for cleaner code.

This update enhances the filtering capabilities and improves the validation logic by removing unnecessary debug outputs.

* Refactor Vue Components for Improved Readability and Consistency

- Update CameraUpload.vue to enhance formatting and maintain consistent indentation for better readability.
- Modify OpenFormField.vue to improve tooltip component formatting, ensuring consistent styling across the application.
- Refactor FormSecurityAccess.vue to enhance the layout of the conditional rendering for captcha providers.
- Adjust RegisterForm.vue to improve the formatting of the terms and conditions section, ensuring consistent indentation and readability.

These changes aim to enhance code maintainability and visual consistency across the components, contributing to a cleaner codebase.

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-15 13:55:42 +08:00
Chirag Chhatrala a59b46665c
Billing flow redirect (#713)
* Billing flow redirect

* fix checkout url

* Refactor checkout and subscription flow

- Improve checkout URL generation with ref unwrapping
- Enhance user data handling in subscription modal
- Remove deprecated CheckoutDetailsModal component
- Update form field and register form styling
- Add more robust user data update mechanism

* Refactor checkout and subscription flow

- Improve checkout URL generation with ref unwrapping
- Enhance user data handling in subscription modal
- Remove deprecated CheckoutDetailsModal component
- Update form field and register form styling
- Add more robust user data update mechanism

* Fix accessibility and checkout URL generation

- Add proper label for terms and conditions checkbox in RegisterForm
- Refactor checkout URL generation in SubscriptionModal using computed refs
- Improve form input handling and reactivity

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-05 19:16:33 +08:00
Julien Nahum 267beec582
Refactor form initialization and data management in OpenForm component (#709)
* Refactor form initialization and data management in OpenForm component

- Add resetAndFill method to Form class for more flexible form data handling
- Update initForm method to use nextTick for better reactivity
- Modify form initialization logic to reset and fill form data more consistently
- Remove unnecessary computed import and add debug console.log

* fix on fill again

---------

Co-authored-by: Chirag Chhatrala <chirag.chhatrala@gmail.com>
2025-03-03 14:29:15 +08:00
Julien Nahum 28248259be Improve form property logic validation for checkbox conditions
- Update FormPropertyLogicRule to handle operators without values
- Add support for checkbox conditions like 'is_checked' and 'is_not_checked'
- Refactor logic validation in both API and client-side implementations
- Remove unnecessary console.log statements
- Update error modal text for better user experience
2025-02-19 15:11:27 +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 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
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
Julien Nahum 97c4b9db5b Fix mentions in front-end + email spam 2024-10-22 11:04:49 +02: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
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
Favour Olayinka 33ad2d41b8
form color reset (#577)
* form color reset

* fix link color

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-09-20 12:02:06 +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
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
Chirag Chhatrala fedc382594
Pricing Upgrade Flow changes (#514)
* Pricing Upgrade Flow changes

* remove extra code

* Refactor subscription plan selection and billing management

* Polish the new pricing modal

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-08-23 12:23:01 +02:00
Chirag Chhatrala a73badb091
Autofocus first field as settings option (#536)
Co-authored-by: Julien Nahum <julien@nahum.net>
2024-08-23 11:32:09 +02:00
Chirag Chhatrala 1ac71ecf8b
Google Fonts (#525)
* Google Fonts

* Google fonts improvement

* font button color

* Refine font selection UI and update font fetching logic

- Update FontsController to fetch Google fonts sorted by popularity.
- Enhance FontCard component with additional skeleton loaders for better UX during font loading.
- Adjust check icon positioning in FontCard to be absolute for consistent UI.
- Remove unnecessary class in GoogleFontPicker's text input.
- Add border and rounded styling to the font list container in GoogleFontPicker.
- Simplify computed property for enrichedFonts in GoogleFontPicker.
- Implement inline font style preview in FormCustomization component.

---------

Co-authored-by: Frank <csskfaves@gmail.com>
Co-authored-by: Julien Nahum <julien@nahum.net>
2024-08-16 16:25:13 +02:00
Favour Olayinka f4386fbcbc
55919 form editor error boundary (#494)
* fix password reset bug

* form editor error boundary

* fix crisp

* fix layout on create and edit pages

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-07-17 16:07:19 +02:00
Julien Nahum fbc0457294 Debugging custom domain redirect opnform
More debugging on custom domain side

Debugging custom domain redirect further

Debugging custom domain redirect opnform

More debugging on custom domain side

Debugging custom domain redirect further
2024-07-15 11:58:23 +02:00
Julien Nahum add60fbde9 Fix init form with default theme 2024-07-01 10:18:35 +02:00
Julien Nahum 2ca2d97e8e
Better form themes (#465)
* Working on custom radius + input size

* Fix date input clear vertical align

* Moslty finished implementing small size

* Polishing larger theme

* Finish large theme

* Added size/radius options in form editor

* Darken help text, improve switch input help location

* Slight form editor improvement

* Fix styling

* Polish of the form editor
2024-06-27 17:52:49 +02:00
Favour Olayinka f40b95977d
0c9ea page break validation (#455)
* fix password reset bug

* page break precognition validation

* precognition validation tests

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-06-24 11:08:54 +02:00
Julien Nahum a4b7bfdbe4 Fix Amplitude: 1 instanciation, track utm 2024-05-14 16:24:31 +02:00
Favour Olayinka 6a18615a84
add c ancel button for confirm alert (#407)
* add c ancel button for confirm alert

* Refactor the No alertConfirm button

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-05-13 14:33:23 +02:00
Favour Olayinka 49e6382bbb
nuxt ui notifications (#390)
* nuxt ui notifications

* use crispInit function

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-05-06 14:19:06 +02:00
Favour Olayinka bcd45ce8a6
0351d front end linting (#377)
* feat: disable custom script for  trial users

* after lint fix

* frontend linting

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-04-15 19:39:03 +02:00
Don Benjamin 75c2107b6c
#365 Use relative urls in the browser to avoid needing to hardcode the domain name (#375)
* #365 Updated documentation for changing ports.  Updated the nuxt config to use separate internal and external api urls

* #365 Switch to using relative urls

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-04-15 16:02:28 +02:00
Chirag Chhatrala 35efd6711d
Remove old code related to notifications (#363)
* Integrations Refactoring - WIP

* integrations list & edit - WIP

* Fix integration store binding issue

* integrations refactor - WIP

* Form integration - WIP

* Form integration Edit - WIP

* Integration Refactor - Slack - WIP

* Integration Refactor - Discord - WIP

* Integration Refactor - Webhook - WIP

* Integration Refactor - Send Submission Confirmation - WIP

* Integration Refactor - Backend handler - WIP

* Form Integration Status field

* Integration Refactor - Backend SubmissionConfirmation - WIP

* IntegrationMigration Command

* skip confirmation email test case

* Small refactoring

* FormIntegration status active/inactive

* formIntegrationData to integrationData

* Rename file name with Integration suffix for integration realted files

* Loader on form integrations

* WIP

* form integration test case

* WIP

* Added Integration card - working on refactoring

* change location for IntegrationCard and update package file

* Form Integration Create/Edit in single Modal

* Remove integration extra pages

* crisp_help_page_slug for integration json

* integration logic as collapse

* UI improvements

* WIP

* Trying to debug vue devtools

* WIP for integrations

* getIntegrationHandler change namespace name

* useForm for integration fields + validation structure

* Integration Test case & apply validation rules

* Apply useform changes to integration other files

* validation rules for FormNotificationsMessageActions fields

* Zapier integration as coming soon

* Update FormCleaner

* set default settings for confirmation integration

* WIP

* Finish validation for all integrations

* Updated purify, added integration formatData

* Fix testcase

* Ran pint; working on integration errors

* Handle integration events

* Remove old code related to notifications

* command for Delete Old Integration Events

* Display Past Events in Modal

* on Integration event create with status error send email to form creator

* Polish styling

* Minor improvements

* Finish badge and integration status

* Fix tests and add an integration event test

* Run linters

---------

Co-authored-by: Forms Dev <chirag+new@notionforms.io>
Co-authored-by: Julien Nahum <julien@nahum.net>
2024-03-28 18:46:29 +01:00
Daniel Roe d9996e0d9d
fix: opt in to `import.meta.*` properties (#364) 2024-03-28 17:59:41 +01:00
formsdev c8628ed840
Separate input type for Rating,Scale,Slider (#351)
* Separate input type for Rating,Scale,Slider

* rating, scale, slider add in test cases

* Allow field type change for new types

* Added options to db factory

* Fix linting

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-03-19 15:27:21 +01:00
Julien Nahum 91911bc6e5 Multiple bug fixing 2024-02-10 12:20:45 +01:00
Favour Olayinka ef83ffcf77
3a703 admin edit submission (#305)
* wip: admin submission edit feature

* wip: refresh form submission after update

* wip: connect submissions page data to store

* Fixed the submission loading issue

* test: admin edit submission feature test

* Fix pending submission, editabe submission & more (#306)

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-02-03 12:50:57 +01:00
Julien Nahum a650228a67 Auto-resize iframes, fix custom code, fix create form initial properties 2024-02-01 18:21:30 +01:00
Julien Nahum 381824183c Fix form AI creation bug + use gpt4 turbo with Json mode 2024-01-29 10:25:00 +01:00
Julien Nahum f156f52608 Fix form password 2024-01-16 13:27:54 +01:00
Julien Nahum 91432c4aed Fix file submissions preview 2024-01-13 19:57:39 +01:00
Julien Nahum bf98497711 Fix local file upload 2024-01-13 18:17:24 +01:00
Julien Nahum be43c5cae3 Fix sentry nuxt and custom domain redirect 2024-01-12 17:32:10 +01:00
Julien Nahum ea7041be28 Add custom domain support 2024-01-12 15:43:28 +01:00
Julien Nahum 5a3978874a URL generation (front&back) + fixed authJWT for SSR 2024-01-11 14:07:27 +01:00
Julien Nahum f26d02c333 Fix env? 2024-01-08 22:23:13 +01:00
Julien Nahum e4177b0ff0 Add .env file at AWS build time 2024-01-08 20:19:29 +01:00
formsdev f87e3f1685
SEO meta nuxt migration (#274)
* SEO meta nuxt migration

* Polish seo metas, add defaults for OG and twitter

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-01-04 18:38:50 +01:00
Julien Nahum 2d41b18323 Fixed amplitude bugs, and added staging environment 2024-01-03 19:03:45 +01:00
Julien Nahum a6d88278be Remove appconfig in favor of runtimeconfig 2024-01-03 17:38:11 +01:00
formsdev 178424a184
Migrate to nuxt settings page AND remove axios (#266)
* Settings pages migration

* remove axios and use opnFetch

* Make created form reactive (#267)

* Remove verify pages and axios lib

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-01-02 13:09:41 +01:00
formsdev 6fd2985ff5
Nuxt Migration notifications (#265)
* Nuxt Migration notifications

* @input to @update:model-value

* change field type fixes

* @update:model-value

* Enable form-block-logic-editor

* vue-confetti migration

* PR request changes

* useAlert in setup
2023-12-31 12:39:01 +01:00