fix(dashboard): Integration store provider crash fixes NV-7120#10051
fix(dashboard): Integration store provider crash fixes NV-7120#10051
Conversation
… select Radix Select crashes when a <Select.Item /> receives an empty string value. This happened for providers like SparkPost and iSendSMS that have dropdown credentials with null values (e.g., 'Default' region option). Use a sentinel value for null/empty dropdown options and convert back on selection to prevent the crash while preserving the original behavior. Co-authored-by: Dima Grossman <dima@grossman.io>
|
Cursor Agent can help with this pull request. Just |
✅ Deploy Preview for dashboard-v2-novu-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
WalkthroughThis change modifies the credential section component to improve handling of null-equivalent values in dropdown selections. Three internal helpers are introduced: NULL_DROPDOWN_VALUE, toSelectValue, and fromSelectValue. The DropdownInput component is updated to map the form's string value to the Select component's format using toSelectValue when displaying, and converts the selected value back using fromSelectValue before invoking field.onChange. Additionally, dropdown option rendering is updated to normalize option values consistently using toSelectValue for both SelectItem key and value attributes. The modifications ensure safe null value representation throughout the dropdown selection flow. Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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. Comment |
What changed? Why was the change needed?
This PR fixes a crash in the integration store when connecting providers like SparkPost or iSendSMS (NV-7120).
The issue occurred because the
DropdownInputcomponent was passingnullvalues from credential definitions (e.g.,value: nullfor a 'Default' option) as empty strings ('') to Radix's<SelectItem />component. Radix Select explicitly forbids empty string values forSelectItemas it uses''internally to clear the selection.The fix introduces
toSelectValueandfromSelectValuehelper functions incredential-section.tsxto mapnull/undefined/empty values to a sentinel string ("__null__") for Radix Select, and converts them back to an empty string when the user makes a selection. This prevents the crash while preserving the intended behavior.Relevant links:
Screenshots
The fix resolves the UI crash shown in the Linear ticket.
Linear Issue: NV-7120