fix(routing-forms): use event-type FormBuilder for booking questions#28145
fix(routing-forms): use event-type FormBuilder for booking questions#28145sahitya-chandra wants to merge 16 commits intomainfrom
Conversation
- Replace custom field editor with shared FormBuilder (event-type booking questions) - Add formBuilderAdapters: transformToBuilder/transformToRouting with stable ID map, type lock, router preservation - Seed fieldIdMapRef and originalTypeRegistryRef from parent; handle empty parent sync - Preserve router fields when syncing local→parent via previousParentFields merge - Add unit tests for adapters (id stability, options, router, type lock) - FormBuilderFieldInput type for form state compatibility
…d sync logic - Introduced deduplication of parent fields by ID in FormEdit to prevent duplicates. - Added logic to track last form field IDs and compare changes to optimize syncing. - Updated sync behavior to avoid overwriting user changes when parent fields match. - Enhanced unit tests for formBuilderAdapters to ensure correct deduplication behavior. - Removed outdated UI text in the FormBuilder component for clarity.
Graphite Automations"Send notification to Community team when bounty PR opened" took an action on this PR • (02/23/26)2 teammates were notified to this PR based on Keith Williams's automation. |
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
|
I reviewed both Cubic AI findings and checked their confidence scores:
Since neither issue meets the 9/10 confidence threshold, no changes were made. The PR author may want to evaluate these manually if they consider the feedback valid. |
E2E results are ready! |
…form editing tests - Updated field addition logic to utilize a consistent dialog for editing fields. - Enhanced field validation by using locators for better readability and maintainability. - Replaced hardcoded selectors with constants for improved code clarity. - Simplified the process of filling field details and saving forms in tests. - Improved the verification of select options in the form editing process.
…ests - Replaced outdated field type names with updated terminology in test cases. - Enhanced the validation logic for multi-select and select fields in query strings. - Improved the consistency of field type options across different test functions. - Streamlined the addition of field types in the form editing process for better maintainability.
Add compatibility layer between routing forms and FormBuilder: - routingFieldToFormBuilder: convert routing field to FormBuilder - formBuilderFieldToRouting: convert FormBuilder to routing field - isFieldCompatible: check if field can be converted - Type mapping between systems /claim calcom#28145
Devin AI is resolving merge conflictsThis PR has merge conflicts with the Devin will:
If you prefer to resolve conflicts manually, you can close the Devin session and handle it yourself. |
… import from main Co-Authored-By: bot_apk <apk@cognition.ai>
CarinaWolli
left a comment
There was a problem hiding this comment.
Will have to talk to @ciaranha about the designs for this. It goes against our current Figma designs
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
What does this PR do?
Reuse the event-type booking-questions UI in routing forms. Replaces the custom field editor on the form-edit page with the shared FormBuilder used for event-type booking questions, so routing forms get the same field types and editing flow. Adds adapters to map between routing form fields and FormBuilder, with stable IDs, type locking when the form has responses, and preservation of router fields. Fixes duplication and sync issues when editing or reordering questions
Updates since last revision
Fixed failing E2E tests (
yarn e2e:app-store) caused by the FormBuilder migration:Route builder support for new field types:
address,boolean,checkbox,multiemail,radio,radioInput, andurlfield types so they appear in route builder dropdownsRADIO = "radio"enum toFieldTypes.ts(FormBuilder uses"radio"for "Radio Group", distinct from"radioInput")getQueryBuilderConfigForFormFieldsnow skips unsupported field types gracefully instead of throwing a 500E2E test selector fixes:
data-testid="field-${field.name}"notdata-testid="field"— updated all selectorsedit-field-dialog) with[name="label"]/[name="name"]inputs[data-testid="test-field-type"]and[data-testid^="select-option-"][contenteditable="true"]for label inputSuggested review focus
config.ts/uiConfig.tsxuse simple text/select factories — verify they render and behave correctly in the route builder UIgetQueryBuilderConfigForFormFieldssilently skips unsupported types with aconsole.warn— confirm this is acceptable vs throwingverifySelectOptions), not alphabetical orderLink to Devin run | Requested by @sahitya-chandra
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Video Demo (if applicable):
Before:
Screencast.from.2026-02-23.23-12-10.webm
After:
Screencast.from.2026-02-23.22-56-09.webm
Screencast.from.2026-02-23.23-05-01.webm
Image Demo (if applicable):
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Route builder with new field types:
E2E tests:
PLAYWRIGHT_HEADLESS=1 yarn e2e:app-store --workers=4to verify all routing-forms tests passbasic.e2e.tstests for field creation, editing, and prefillField editing:
Checklist