fix: improve pre-filled address formatting#18898
fix: improve pre-filled address formatting#18898JASSBR wants to merge 1 commit intotwentyhq:mainfrom
Conversation
Add space after comma separator in address field values for proper formatting (e.g. "New York, NY" instead of "New York,NY"). Fixes twentyhq#18860
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return subFields | ||
| .map((subField) => fieldValue[subField]) | ||
| .filter(isNonEmptyString) | ||
| .join(','); | ||
| .join(', '); |
There was a problem hiding this comment.
This change only adds a space after commas in the joined display string. The linked issue (#18860) describes duplicated city/country (etc.) remaining in Address 1 after selecting a suggestion, which is a different problem (data normalization/prefill mapping) and likely won’t be resolved by changing the join separator. Either adjust the PR description/issue linkage, or add the logic that strips city/state/postcode/country from addressStreet1 when populating the structured subfields.
Welcome!
Hello there, congrats on your first PR! We're excited to have you contributing to this project. |
Summary
","to", "injoinAddressFieldValues.ts"123 Main St, New York, NY"instead of"123 Main St,New York,NY"Test plan
joinAddressFieldValuesandformatAddressDisplaytestsFixes #18860