-
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: distance - share with accountant #51517
fix: distance - share with accountant #51517
Conversation
src/libs/ModifiedExpenseMessage.ts
Outdated
if (reportActionOriginalMessage?.movedToReportID) { | ||
return "Moved this expense"; // todo: copy needed | ||
} |
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.
@neil-marcellini could we please request a copy for this action?
It's added as the first report action after I share my tracked expense with an accountant.
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.
Don't we already have a message like this when moving a manual expense for example? Can we use the same copy?
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.
@neil-marcellini no, the fallback is shown for those expenses as well:
Made some progress on the PR today. |
With the recent changes, seems like the flow works fine (please see the recordings). |
@Pujan92 I believe only the copy is pending here, therefore you can start testing the flow. |
I asked for a copy check on the issue |
@neil-marcellini since we went live with the P2P distance requests, will there be any cleanup for the |
@neil-marcellini for the in-existing rate, would this format work (message TBD)? When incorrect route is selected, we don't show the field error, but a form error at the bottom. I'm wondering if we should keep this behavior consistent (I just added the RBR for better clarity of which field is faulty): |
I already removed all of them on main, so please make sure that's removed here too. |
@paultsimura I like what you did there with the RBR on the field and the form error message at the bottom. If you want, you could also do that for the route error, or tackled that in a separate PR. |
Got a bit stuck on the PR – asked a couple of clarifying questions here. |
@neil-marcellini @Pujan92 the PR is almost ready. However, I have an issue with the dependency cycle. We've agreed on using the root level report name in the I'd like to reuse the Lines 4015 to 4018 in c049ac7
What would be your suggestion to avoid this cycle? I could potentially move all of these functions into separate files and export them all from Or I could force allow the dependency cycle. But maybe you could suggest a more elegant approach. |
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 great to me, thanks
const destinationReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${destinationReportID}`]; | ||
const rootParentReport = getRootParentReport(destinationReport); | ||
|
||
// The "Move report" flow only supports moving expenses to a policy expense chat or a 1:1 DM. | ||
const reportName = isPolicyExpenseChat(rootParentReport) ? getPolicyExpenseChatName(rootParentReport) : buildReportNameFromParticipantNames({report: rootParentReport}); | ||
const policyName = getPolicyName(rootParentReport, true); |
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 have an issue with the dependency cycle #51517 (comment)
Can't we move this part to ReportUtils to avoid dependency cycle issue?
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.
No. ReportUtils
already imports ModifiedExpenseMessage
, so the cycle will be present anyway.
The cycle will be resolved holistically after https://expensify.slack.com/archives/C01GTK53T8Q/p1733492380567339
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.
Ah yes, it will be the same. 😓
Only issue I am seeing is that there is some distance unit(km and ml) inconsistency after the rate selection and with the price in the preview. Screen.Recording.2024-12-10.at.23.23.06.mov |
I saw that too, but it should be out of scope 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.
LGTM, Thanks!
# Conflicts: # src/libs/actions/IOU.ts
const parameters = { | ||
onyxData, |
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.
@neil-marcellini I had a conflict with recently merged #52221 which you reviewed as well.
Please let me know what you think about explicitly specifying the params subtypes that I've added in this PR (this change and a couple below) to avoid passing redundant data.
If it's a good practice, maybe it should be encouraged in other refactoring PRs as well.
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.
Ah yes, that does seem like a good practice. Thanks.
@paultsimura can you please explain why the bug with the unit inconsistency should be out of scope? It seems like something we can and should fix as part of this flow. |
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 good except that one bug
const parameters = { | ||
onyxData, |
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.
Ah yes, that does seem like a good practice. Thanks.
Because it is something that already exists in prod (so not caused by my changes) and is not described in the initial issue steps and expectations. Also, the nature of the bug is different from the one we are resolving now, although it's also related to the "share expense" flow. If we want to fix this as well, I would like to request bounty bump to $500 as it is a good chunk of extra work — we've already expanded the scope on this PR compared to the accepted proposal. |
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.
Thanks for clarifying that the bug is on prod and yes I agree that this has already been a lot of work 😅. Please report the bug, tag me, and let's work on it as a quick follow up.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.0.75-0 🚀
|
@paultsimura QA team faund issue #53988 when validation this PR |
Thanks @izarutskaya, we've already established that it's only been revealed by this PR, not caused by it. |
Hey @paultsimura @Pujan92 @neil-marcellini. We have a blocker that might be related to these distance changes. Users are now unable to change distance rate because backend is not receiving the required If you could take a quick look that would be very helpful. |
That issue indeed seems to be caused by this PR, although it looks BE to me. I replied in your GH, let's keep the conversation there for clarity. |
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.75-6 🚀
|
Details
This PR is intended to fix several issues with the tracked distance expenses shared with accountants.
Fixed Issues
$ #46897
PROPOSAL: #46897 (comment)
Tests
Same as QA
Offline tests
Same as QA
QA Steps
Violation flow
Auto-select rate flow
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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 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
2024-11-13.-.20.27.-.android.mp4
Android: mWeb Chrome
2024-11-13.-.20.27.-.chrome.mp4
iOS: Native
2024-11-13.-.20.20.-.Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-11-13.at.19.54.36.mp4
iOS: mWeb Safari
2024-11-13.-.20.20.-.Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-11-13.at.19.53.07.mp4
MacOS: Chrome / Safari
2024-11-13.-.16.08.-.Screen.Recording.2024-11-13.at.16.05.08.mp4
MacOS: Desktop
2024-11-13.-.17.01.-.Screen.Recording.2024-11-13.at.17.00.31.mp4