refactor split phrase phoneError using RenderHTML#64704
Conversation
|
@allgandalf Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@allgandalf This PR is ready for review |
|
👋 @PiyushChandra17 you have conflicts on this one, can you resolve please? Thanks! |
|
@trjExpensify Done |
|
@PiyushChandra17 conflicts still exist |
…andra17/refactor/splitphrase-phoneError
|
@allgandalf Conflicts fixed |
There was a problem hiding this comment.
@PiyushChandra17 The above image shows the size of the link text on staging, please match the same, currently on your PR the link text size is a lot bigger
@
|
@allgandalf i think applying fontSize to 13px to that link matches the staging size |
|
@allgandalf Updated the link size to match the staging, now need to figure this out how to set
|
|
cool, lmk once this is ready |
|
@PiyushChandra17 please resolve conflicts |
|
|
@allgandalf i think wrapping the rbr tag with comment tag will solve this underline link issue |
|
@allgandalf I think it's fully fledged working now, removed that underline. Here's the screenshot
|
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the travel booking phone error message to use RenderHTML instead of split phrases. It consolidates multiple translation components (phrase1, link, phrase2) into a single HTML string that contains the link element, improving maintainability and localization consistency.
Key Changes
- Refactored
phoneErrortranslations across all language files from object with separate phrases to HTML function with embedded link - Updated BookTravelButton component to use RenderHTML component instead of manual Text/TextLink composition
- Added PhoneErrorRouteParams type for translation function parameters
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/languages/*.ts | Converted phoneError from object with separate phrases to HTML function with embedded link |
| src/languages/params.ts | Added PhoneErrorRouteParams type definition |
| src/components/BookTravelButton.tsx | Updated to use RenderHTML and removed manual Text/TextLink construction |
| src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx | Removed hardcoded textDecorationLine underline style |
| docs/articles/travel/getting-started/Common-Travel-Terms-and-Abbreviations.md | Fixed typo "Expatriot" to "Expatriate" |
| cspell.json | Added travel-related terms to spelling dictionary |
Comments suppressed due to low confidence (1)
cspell.json:758
- Missing comma after "iaco" entry. This will cause a syntax error in the JSON file.
"iaco"
|
@allgandalf I think now this is fully fledged ready and the line height is set to 16px and it matches with staging cc: @shawnborton |
|
Awesome, thank you for the adjustments! |
|
Please fix the failing tests |
|
@allgandalf Done + |
| "ASPAC", | ||
| "CLIA", | ||
| "EMEA", | ||
| "ESTA", | ||
| "IBTA", | ||
| "NBTA", | ||
| "Cliqbook", | ||
| "GDSO", | ||
| "TIMATIC", | ||
| "UDIDS", | ||
| "VMPD", | ||
| "midoffice", | ||
| "airside", | ||
| "outplant", | ||
| "rebooking", | ||
| "Heathrow", | ||
| "eticket", | ||
| "eraa", | ||
| "FWTV", | ||
| "EDIFACT", | ||
| "NLRA", | ||
| "NTSB", | ||
| "TBUM", | ||
| "iaco", |
There was a problem hiding this comment.
| "ASPAC", | |
| "CLIA", | |
| "EMEA", | |
| "ESTA", | |
| "IBTA", | |
| "NBTA", | |
| "Cliqbook", | |
| "GDSO", | |
| "TIMATIC", | |
| "UDIDS", | |
| "VMPD", | |
| "midoffice", | |
| "airside", | |
| "outplant", | |
| "rebooking", | |
| "Heathrow", | |
| "eticket", | |
| "eraa", | |
| "FWTV", | |
| "EDIFACT", | |
| "NLRA", | |
| "NTSB", | |
| "TBUM", | |
| "iaco", |
Reverse these changes.
There was a problem hiding this comment.
Hmm, was skeptical about that
| | executive card | Types of privilege cards available to frequent users of airlines, hotel chains, car rental companies, etc. Most carry benefits and have their own brand names (e.g., British Airways Executive Blue, Executive Silver, Executive Gold and Premier). | | ||
| | executive room | Higher grade than standard room and usually slightly larger, the executive room often has additional facilities for the business traveler such as trouser press, desk etc. and may be located on a separate Executive Club Floor. | | ||
| | Expatriot (or expat) | An expatriate (in abbreviated form, expat) is a person temporarily or permanently residing in a country and culture other than that of the person’s upbringing or legal residence. | | ||
| | Expatriate (or expat) | An expatriate (in abbreviated form, expat) is a person temporarily or permanently residing in a country and culture other than that of the person’s upbringing or legal residence. | |
There was a problem hiding this comment.
| | Expatriate (or expat) | An expatriate (in abbreviated form, expat) is a person temporarily or permanently residing in a country and culture other than that of the person’s upbringing or legal residence. | | |
| | Expatriot (or expat) | An expatriate (in abbreviated form, expat) is a person temporarily or permanently residing in a country and culture other than that of the person’s upbringing or legal residence. | |
Same here
|
bump @PiyushChandra17 |
|
@allgandalf Same for this one .. |
|
@allgandalf I think we are good to go here ... cc: @shubham1206agra |
| styles.link, | ||
| { | ||
| fontSize: HTMLEngineUtils.getFontSizeOfRBRChild(tnode), | ||
| textDecorationLine: 'underline', |
There was a problem hiding this comment.
@allgandalf To remove the underline from the link
Reviewer Checklist
Screenshots/Videos
|
|
@roryabraham This PR can be merged now. |
|
@roryabraham bump here 👀 . Thanks |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Thanks for the merge here, a special shoutout to @allgandalf for the amazing mentorship here. He's my MENTOR 😄 |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.2.9-0 🚀
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.2.11-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.2.12-4 🚀
|





Explanation of Change
refactor split phrase phoneError using
RenderHTMLFixed Issues
$ #62808
PROPOSAL: #62808 (Comment)
Tests
Pre-condition: Login via
phone numberOffline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop