Improve custom rules formatting#56562
Conversation
|
@techievivek 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] |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
@ 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] |
|
🚧 @puneetlath has triggered a test build. You can view the workflow run here. |
|
🚧 @puneetlath has triggered a test build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
🚧 @puneetlath has triggered a test build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/puneetlath in version: 9.0.96-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.96-1 🚀
|
| const {translate} = useLocalize(); | ||
| const styles = useThemeStyles(); | ||
| const policy = usePolicy(policyID); | ||
| const parsedRules = useMemo(() => getParsedComment(policy?.customRules ?? ''), [policy]); |
There was a problem hiding this comment.
Looks like here we did take into consideration the fact that when we submit markdown input, that input won't actually be formatted and displayed as markdown in the input field while awaiting for BE to return a response based on the natural language submitted input, which led to this issue:
The issue was fixed by adding an Onyx isLoading variable in the API request such that while loading (awaiting BE response) we're passing the shouldEscapeText: false option to the getParsedComment function such that the markdown input is actually displaying formatted markdown in the input until BE response is received - see PR #57599 for details on the fix.
Explanation of Change
Updates the display of the custom rules section to support markdown/html and show as multi-line.
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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