* fix: change URL prefill behavior to skip only invalid fields
Previously, when prefilling booking form fields from URL query parameters,
if any single field failed validation, all prefilling was skipped and an
empty object was returned.
This change modifies the behavior so that only invalid fields are skipped,
while valid fields are still prefilled. The implementation:
- Adds validateSingleFieldForPrefill() to validate individual fields
- Adds parseFieldByField() to collect valid fields when full parse fails
- Modifies getBookingResponsesPartialSchema to use field-by-field parsing
as a fallback when full schema validation fails
- Logs which specific fields were skipped and why
This improves user experience by preserving valid prefill data even when
some fields have invalid values.
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* refactor: reduce code duplication in partial prefill validation
Simplify the implementation by integrating field-by-field error handling
directly into the existing preprocess() function instead of using separate
helper functions.
Changes:
- Remove validateSingleFieldForPrefill() and parseFieldByField() functions
- Simplify getBookingResponsesPartialSchema to directly use preprocess()
- Add try-catch wrapper in preprocess() when isPartialSchema=true
- Continue processing other fields even if one fails during preprocessing
- Log skipped fields with reasons at debug level
This reduces code duplication while maintaining the same behavior of
skipping only invalid fields during URL prefill.
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* fixes
* refactor: rename getRefinedValue to superRefineField and add edge case tests
- Rename getRefinedValue to superRefineField for clarity
- Remove duplicate multiselect test block
- Add test for empty object name field during partial prefill
- Add test for invalid URL format during partial prefill
- Add test for null responses during partial prefill
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* Simplifu
* Simplif more
* Enhance booking responses schema tests to validate required fields and name variants. Updated error handling for empty names and added tests for first and last name requirements. Refactored schema validation logic to improve clarity and maintainability.
* fix types
* test: add test for email validation behavior during partial prefill
Documents that email validation is relaxed to z.string() during partial prefill,
consistent with phone field behavior where partial values like '+91' are accepted.
This addresses Cubic AI feedback (confidence 9/10) to verify email handling.
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* fix
* Add tests: packages/features/bookings/lib/getBookingResponsesSchema.test.ts
Generated by Paragon from proposal for PR #26982
* Revert "Add tests: packages/features/bookings/lib/getBookingResponsesSchema.test.ts"
This reverts commit fc2b7ad7ca8099bc4f68e97b383ea16b41cdd772.
* Simplify
* fix: sanitize partial prefill log to avoid exposing user input data
Replaced raw Zod issues array in console.warn with a count of
validation errors to prevent sensitive user data from being logged.
Issue identified by cubic (confidence 9/10).
Co-Authored-By: unknown <>
* fix
* Remove throw Error
* Refactor booking responses schema tests to use helper functions for assertions
- Introduced `expectResponsesToBe` and `expectParsingToFail` helper functions to streamline test assertions.
- Replaced direct assertions with these helper functions for improved readability and maintainability.
- Removed redundant error handling code to simplify test logic.
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* move SystemField to features
* migrate workflow service
* merge two tests for team repository
* update imports and migrate team repository
* migrate delegation credential repository
* migrate credential repository
* migrate entityPermissionUtils
* migrate hashedLink service and repository
* migrate membership service
* update imports
* remove file
* migrate buildEventUrlFromBooking
* migrate getAllUserBookings to features
* update imports
* update organizationMock
* migrate slots
* migrate date-ranges to schedules dir
* migrate getAggregatedAvailability
* fix
* refactor
* migrate useCreateEventType hook to features
* migrate assignValueToUser
* migrate validateUsername to auth features
* migrate system field back to lib
* migrate getLabelValueMapFromResponses back to lib
* update imports
* use relative path
* fix type checks
* fix
* fix
* fix tests
* update gh codeowners
* fix
* fix
* fix: trigger lingo.dev by removing duplicate value
* feat: allow urls without an explicit https://
* fixed the test that ensures malformed URLs like "http:/nope" are rejected
---------
Co-authored-by: Tushar Bhatt <95581504+TusharBhatt1@users.noreply.github.com>
* feat:add prefilcheck check box in the field creation
* chore:formatted the li8 translations
* feat:add e2e test case for this feature
* refactor:reanmed the key from prefilledCheck to disableOnPrefill and moved the readOnly logic to formbuilderField
* chore:fixed the type check
* fix:if prefilled has error. do not disabble it
* chore:removed the e2e tests for prefill in e2e
* chore:revert back to old changes
* chore:remove unwanted code frome2e
* Support name field as well
* refactor:handled the feedback changes. still unit test cases pending
* feat: add unit tests for disable field on prefill logic
* chore: resolved the type check and typos
* chore:renamed the files and type clean up
* Apply suggestions from code review
* chore:renaming test files and moving the disableonprefill hook to formbuilderFeild.
* refactor: add unit test for serach params and form values check and minor code formatting and file name changes
* fix: validating the input value partially at the intialising phase. so that form response values and from ui values are same and making sure invalid data not sent to backend on submit.
* chore:fix the type check issue
* fix: field value valdiation at initilisation and add the unit test cases for that change
* chore:add comments to the tests
* chore:resolve type check
* chore: moved the tests to the formBuilder
* Simplify codebase by ensuring select and multiselect changes the value when no option is found
* Relocate and refactor tests
* handle special cases
* Dont disable for dirty fields
* Update schema.prisma
---------
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
Co-authored-by: Hariom <hariombalhara@gmail.com>
* your name translation fixed
* do translation outside Components as that is needed by all components. Allows the code to stay DRY
---------
Co-authored-by: Hariom <hariombalhara@gmail.com>
* Add split full name variant
* Share propsType across fieldTypes and components
* Simplify Components
* Add assertions for required field indicator
* Fix test as name cant be used as a custom field right now
* Make it disabled during reschedule
* Fix UI issues in dark mode
* Support adding links in boolean checkbox
* Revert "Support adding links in boolean checkbox"
This reverts commit 31252f8a5f445f8289a09445124109a4a9c3d33b.
* Make sure getBookingFields isnt import client side
* PR feedback addressed from Carina
* DRY Code
* Fix Dialog
---------
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>