-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
fix: Transaction report shows multiline title for expense with multiline description #42631
Conversation
@DylanDylann 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] |
src/libs/ReportUtils.ts
Outdated
@@ -3153,7 +3153,7 @@ function getReportName(report: OnyxEntry<Report>, policy: OnyxEntry<Policy> = nu | |||
if (isArchivedRoom(report)) { | |||
formattedName += ` (${Localize.translateLocal('common.archived')})`; | |||
} | |||
return formattedName; | |||
return formattedName.replace(/(\r\n|\n|\r)/gm, ' '); |
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.
Line 3155 in e8ae3c5
return formattedName; |
Should we apply the same fix in here?
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.
@nkdengineer Could we use formatReportLastMessageText
function instead of replacing manually?
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.
Should we apply the same fix in here?
I think we can apply the same for this to prevent the same bug in the feature.
Could we use formatReportLastMessageText function instead of replacing manually?
Yes we can use this function.
@DylanDylann I updated. |
@DylanDylann Any update here. |
@@ -3266,7 +3266,7 @@ function getReportName(report: OnyxEntry<Report>, policy: OnyxEntry<Policy> = nu | |||
} | |||
|
|||
if (formattedName) { | |||
return formattedName; | |||
return formatReportLastMessageText(formattedName); |
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.
I am not sure if it is necessary or not, could you explain why we need to update this?
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.
@DylanDylann The update here is to prevent similar bugs in the future if the formattedName variable ever contains a line break.
Reviewer Checklist
Screenshots/Videos |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
This PR is failing because of issue #41584 The issue is reproducible in: Web ( QA team is checked on Web for now) 42631.web.mp4 |
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.79-11 🚀
|
Details
Fixed Issues
$ #41584
PROPOSAL: #41584 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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.mov
Android: mWeb Chrome
android-mweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov