-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Improve custom rules formatting #56562
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
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 🚀
|
@@ -16,6 +17,8 @@ function CustomRulesSection({policyID}: CustomRulesSectionProps) { | |||
const {translate} = useLocalize(); | |||
const styles = useThemeStyles(); | |||
const policy = usePolicy(policyID); | |||
const parsedRules = useMemo(() => getParsedComment(policy?.customRules ?? ''), [policy]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop