-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$250] Split & Invoice -Preview shows empty receipt placeholder when there is no way to add a receipt #53524
Comments
Triggered auto assignment to @garrettmknight ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
Job added to Upwork: https://www.upwork.com/jobs/~021864292349376469824 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil ( |
I don't think we'll need to block the deploy for this fix. |
Edited by proposal-police: This proposal was edited at 2024-12-04 13:06:23 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Empty receipt placeholder is displayed for split and invoice preview when there is no option to add a receipt in the first place. What is the root cause of that problem?We always show the App/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx Line 351 in 1462048
App/src/components/ReceiptImage.tsx Lines 111 to 115 in 361a024
What changes do you think we should make in order to solve the problem?We should hide the receipt component if the transaction doesn't have the receipt and it's split in
App/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx Line 351 in 1462048
And hide it in
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?It's a UI bug and I don't think we need a test case here. Or we can create a util
What alternative solutions did you explore? (Optional) |
@mkzie2 Thanks for your proposal. The RCA is correct as we are showing the receipt preview without checking if we can show receipt preview or not. However, instead of focusing on the condition to show, can you please update the proposal to focus on when not to show (i.e. when split and invoice preview). |
Edited by proposal-police: This proposal was edited at 2024-12-04 14:28:36 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Split & Invoice -Preview shows empty receipt placeholder when there is no way to add a receipt What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
// This is just pseudocode, we can refactor this in the PR.
const isInvoice = ReportUtils.isInvoiceReport(iouReport);
const canUserPerformWriteAction = !!ReportUtils.canUserPerformWriteAction(iouReport);
const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
const isApprover = ReportUtils.isMoneyRequestReport(iouReport) && iouReport?.managerID !== null && session?.accountID === iouReport?.managerID;
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const isRequestor = currentUserPersonalDetails.accountID === action?.actorAccountID;
const canEditReceipt = canUserPerformWriteAction && ReportUtils.canEditFieldOfMoneyRequest(action, CONST.EDIT_REQUEST_FIELD.RECEIPT);
const isSettled = ReportUtils.isSettled(iouReport?.reportID);
const shouldShowReceiptEmptyState =
!isInvoice && !isApproved && !isSettled && (canEditReceipt || isAdmin || isApprover || isRequestor) && (canEditReceipt || ReportUtils.isPaidGroupPolicy(iouReport));
const lastThreeTransactions = allTransactions.slice(-3).filter((t) => TransactionUtils.hasReceipt(t) || shouldShowReceiptEmptyState);
const lastThreeReceipts = lastThreeTransactions.map((transaction) => ({...ReceiptUtils.getThumbnailAndImageURIs(transaction), transaction}));
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional) |
@rojiphil could you please check my proposal? Thanks! |
@mkzie2 @Krishna2323 Thanks both for your proposals. However, your proposals lack clarity on both the root cause and the solution and is unacceptable to me in its current form. Can you please be more precise with respect to the root cause and solution? |
Updated proposal. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
ProposalPlease re-state the problem that we are trying to solve in this issue.We should not display empty receipt placeholder for split and invoice previews as there is no provision to add a receipt at all for these cases. What is the root cause of that problem?Previous to the PR #52848, we displayed What changes do you think we should make in order to solve the problem?For invoice rooms, we need to prevent showing receipt thumbnail for the report preview of all invoices. This can be done here by conditionally displaying as demonstrated below:
Further, the receipt thumbnail image for split previews is displayed here. We can leverage the existing
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional) |
@mkzie2 @Krishna2323 Since your proposals are still unacceptable to me in it’s current form, I have put forward a proposal to avoid further delays here. Let me know if you think your proposal is still better. |
@mkzie2 Maybe I am missing something here. Can you please share a test video based on your proposal? I think that can help us understand the difference.
And, I am not sure of this use case. But it should be clear once we have a test video of your proposal. |
@rojiphil, I'm not sure what's missing in my proposal, It uses the same logic as applied in |
@Krishna2323 Why is there a need to introduce many changes when we can keep the fix simple with minimal changes? But let me know if there is any distinct advantage in your proposal that I missed. And I would be happy to revisit your proposal. Thanks. |
@garrettmknight, @rojiphil Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Will respond to this within a hour. |
I understood what is different here. The invoice case should be updated in
Here is the case what I thought, the split bill still can have the receipt. Screen.Recording.2024-12-16.at.16.57.15.mov |
@rojiphil, the reason for adding the same logic used in
receipt_placeholder_shown_in_preview.1.mp4
|
Thanks @mkzie2 @Krishna2323 for the follow-up with your proposals. Let’s go with @Krishna2323 proposal |
Triggered auto assignment to @lakchote, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@Krishna2323's proposal LGTM. |
📣 @rojiphil 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @Krishna2323 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@garrettmknight @rojiphil @lakchote @Krishna2323 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
PR will be up within 24 hours. |
@rojiphil PR is ready for review ^, sorry for delay🙏🏻 |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.71-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Empty receipt placeholder should not be displayed for split and invoice preview because there is no option to add a receipt in the first place.
Actual Result:
Empty receipt placeholder is displayed for split and invoice preview when there is no option to add a receipt in the first place.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6683822_1733279800030.receipt.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @rojiphilThe text was updated successfully, but these errors were encountered: