-
Notifications
You must be signed in to change notification settings - Fork 10.2k
fix: Custom Event Redirect in Routing Form with Dropdown Based fields #17870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
This PR is being marked as stale due to inactivity. |
This PR is being marked as stale due to inactivity. |
This PR is being marked as stale due to inactivity. |
@hariombalhara is this still relevant? |
Yeah It should be . Retesting it |
…rect-routing-forms
…f field labels - Fix custom URL redirects to substitute selected option labels (e.g., 'India') instead of field labels (e.g., 'Country') - Fix preview to show substituted variables instead of placeholders - Add getHumanReadableFieldResponseValue service to handle field value resolution - Move getLabelsFromOptionIds and ensureStringOrStringArray to centralized service location - Add comprehensive tests for variable substitution with select, text, and number fields - Fix TestForm to not call team member matching for custom URLs (eventTypeId check)
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
What does this PR do?
Fixes routing forms variable substitution to use selected option labels instead of field labels when substituting variables in custom event redirect URLs.
Fixes PRI-304
The Bug
When using variables like {Country} in routing form custom URLs (e.g., /team/{Country}/meeting), the system was incorrectly substituting the selected option's UID instead of the selected option's label (e.g., "India"). This made the feature unusable for dropdown fields.
Root Cause
The
substituteVariables
function was usingresponse[key].value
which contains the selected option's UID, not the selected option's label. For dropdown fields, we need to look up the option label using the option ID stored inresponse[key].value
.Type of change
How should this be tested?
/team/{Country}/30min
){Country}
Testing Coverage
Added comprehensive test coverage:
getHumanReadableFieldResponseValue
service (15 tests)substituteVariables
with select, multiselect, text, and number fields (15 tests)Changes Made
Core Fix
response[key].label
toresponse[key].value
with proper option label lookupgetHumanReadableFieldResponseValue
service to handle field value resolution for all field typesService Organization
getLabelsFromOptionIds
andensureStringOrStringArray
to centralized location:packages/lib/server/service/routingForm/responseData/
Preview Fix
eventTypeId
is missing)CSV Export Fix
Mandatory Tasks
Risk Assessment
.toString()
for array concatenation to maintain existing behavior