-
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] "Approve" button showing for pending card transactions in search
#56791
Comments
Triggered auto assignment to @miljakljajic ( |
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989 |
Reproduction Step:
Screen.Recording.2025-02-13.at.10.54.32.mov@miljakljajic As this Slack message, the first C+ to post on the GH issue with reliable reproduction steps and video or screenshots confirming reproduction will be assigned as C+. |
In my opinion, the problem here is that the snapshot hasn't been updated correctly Screen.Recording.2025-02-13.at.10.56.02.mov |
search
search
Job added to Upwork: https://www.upwork.com/jobs/~021890041032822918106 |
Triggered auto assignment to @dylanexpensify ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
@m-natarajan @shawnborton Hi I am a new contributor and I am not clear how to send card transaction . Could someone please share the steps to send card transaction. Thank you |
Hmm good question. @mountiny any good advice there for getting pending transactions for our contributors? |
@shawnborton Are these reports you've approved within the same session? The A simulation of a pending card transaction in the correct state would be: Onyx.merge('transactions_<TRANSACTIONID>', {bank: "Expensify Card", cardId: 4, status: "Pending"})
Onyx.merge('snapshot_<SNAPSHOT_ID>', {data: {transactions_<TRANSACTIONID>: {bank: "Expensify Card", cardId: 4, status: "Pending"}}}) |
Ah actually maybe this is indeed fixed. That being said, I still think that maybe the "Pending" badge is more helpful than a View button in this case? So I think we should still move forward and change the View button to a Pending badge. |
@shawnborton If it happened for you recently, there's probably still a problem since the fix I mentioned was merged quite a while ago and heavily depended on simulated data 😄 If you're able to see if it still happens on login, that'd help see if there's still a (potentially BE) issue. |
I'll keep my eye out the next time I have pending transactions sent to me. Regardless, let's move forward with the badge idea. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Currently we display What is the root cause of that problem?We don't currently handle the Lines 361 to 370 in 44cf172
What changes do you think we should make in order to solve the problem?Assuming we only want to do this for pending card transactions, we can add the following here: const hasOnlyPendingCardTransactions = allReportTransactions.length > 0 && allReportTransactions.every((t) => isExpensifyCardTransaction(t) && isPending(t));
if (hasOnlyPendingCardTransactions) {
return CONST.SEARCH.ACTION_TYPES.PENDING;
} We need to do this before the following section as otherwise we return early with a Lines 333 to 335 in 358f423
We also need to add In order to actually display the badge icon and text, we need to update the
To this: const shouldUseViewAction = action === CONST.SEARCH.ACTION_TYPES.VIEW || (parentAction === CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID) || (parentAction === CONST.SEARCH.ACTION_TYPES.PENDING && action === CONST.SEARCH.ACTION_TYPES.PENDING); To keep the code DRY, we can reuse the same output for App/src/components/SelectionList/Search/ActionCell.tsx Lines 56 to 73 in 01dfa6d
Update the condition to this: if ((parentAction !== CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID) || action === CONST.SEARCH.ACTION_TYPES.DONE || (parentAction !== CONST.SEARCH.ACTION_TYPES.PENDING && action === CONST.SEARCH.ACTION_TYPES.PENDING)) { Then we just need to adjust (1) the For (1) we can do this: const isSuccessStatus = (parentAction !== CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID) || action === CONST.SEARCH.ACTION_TYPES.DONE; For (2) we switch out the icon like this:
And then use those in the component: <Badge
...
icon={icon}
...
success={isSuccessStatus}
/> Result: What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A as this would be a UI tweak. |
Hmmm good call out, though I think I would just use a "Pending" badge there too instead of making it say View. But actually, this makes me wonder if we should just change the card icon to something like this: And then just keeping the View button as it is, since the column is indeed called the "Action column"? Thoughts @Expensify/design @trjExpensify @JmillsExpensify ? |
Love the icon update. Big fan of that improvement. And I definitely see the line of thinking regarding the action column/view button. I think if we want to also add the pending badge, I might put it next to the amount rather than the merchant (though classic shows the pending badge to the right of the merchant...) |
I was thinking the beginning of the Merchant column so it always has the same left-alignment if you had multiple pending expenses... but I don't feel too strongly. I think even just starting with an icon update is helpful. Let's see what others think too. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Add pending bage for pending card transaction What is the root cause of that problem?This is a new feature What changes do you think we should make in order to solve the problem?In the
Optional: We can also hide the badge if the If we want to do it in the merchant cell we can move this logic to the What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?None What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
Good shout—I didn't think about that. I don't feel super strongly! |
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:
Reproducible in staging?: need reproduction
Reproducible in production?: need reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @shawnborton
Slack conversation (hyperlinked to channel name): Expense
Action Performed:
Expected Result:
There should not be a approve button
Let's use a
Pending
badge like so:Actual Result:
Approve button is displayed
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
CleanShot.2025-02-12.at.15.48.29.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @thesahindiaThe text was updated successfully, but these errors were encountered: