-
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
[$250][P2P Distance] - Amount field is not grayed out when changing distance rate offline #46880
Comments
Triggered auto assignment to @RachCHopkins ( |
Triggered auto assignment to @johnmlee101 ( |
👋 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:
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Amount field is not grayed out when changing distance rate offline What is the root cause of that problem?We are checking for amount change pending action only here
What changes do you think we should make in order to solve the problem?We should also check for tax rate change pending action too <OfflineWithFeedback pendingAction={getPendingFieldAction('amount') ?? getPendingFieldAction('customUnitRateID')}> What alternative solutions did you explore? (Optional) |
Edited by proposal-police: This proposal was edited at 2024-08-08 07:31:44 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Distance - Amount field is not grayed out when changing distance rate offline What is the root cause of that problem?In Lines 2527 to 2553 in 963f8ce
Lines 2498 to 2500 in 963f8ce
What changes do you think we should make in order to solve the problem?Define if (transaction && updatedTransaction && (hasPendingWaypoints || hasModifiedDistanceRate)) {
updatedTransaction = {
...updatedTransaction,
...TransactionUtils.calculateAmountForUpdatedWaypointOrRate(transaction, transactionChanges, policy, ReportUtils.isExpenseReport(iouReport)),
};
pendingFields = {...pendingFields, amount: 'update'};
clearedPendingFields = {...clearedPendingFields, amount: null};
errorFields = {...errorFields, amount: {[DateUtils.getMicroseconds()]: Localize.translateLocal('iou.error.genericEditFailureMessage')}};
Note: We only need to update the pending action for App/src/pages/home/report/ReportActionItem.tsx Lines 636 to 637 in 53eee53
App/src/libs/ModifiedExpenseMessage.ts Lines 115 to 138 in 53eee53
What alternative solutions did you explore? (Optional) |
Not a blocker since the rate field is still behind a beta. |
Job added to Upwork: https://www.upwork.com/jobs/~01199ead94cf3782d9 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee ( |
Reviewing proposals tomorrow! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Distance - Amount field is not grayed out when changing distance rate offline What is the root cause of that problem?In What changes do you think we should make in order to solve the problem?By following this pattern. We can modify ....
modifiedAmount: updatedAmount,
modifiedMerchant: updatedMerchant,
modifiedCurrency: updatedCurrency,
pendingFields: {
...transaction?.pendingFields,
...(!lodashIsEqual(updatedAmount, transaction?.modifiedAmount ?? transaction?.amount) && { amount: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE }),
...(!lodashIsEqual(updatedMerchant, transaction?.modifiedMerchant ?? transaction?.merchant) && { merchant: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE }),
...(!lodashIsEqual(updatedCurrency, transaction?.modifiedCurrency ?? transaction?.currency) && { currency: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE })
},
}; This way we only add pending fields, if the value actually change. the pending field not only amount, it can also merchant or currency. Then we can move / modify this step to the step after we finished modify Modify the src/libs/actions/IOU.ts ....
// Set any "pending fields" (ones updated while the user was offline), includes the fields that affected to have error messages in the failureData
const allTransactionChanges = { ...transactionChanges, ...(updatedTransaction ? updatedTransaction.pendingFields : {}) }
const pendingFields = Object.fromEntries(Object.keys(allTransactionChanges).map((key) => [key, CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE]));
const clearedPendingFields = Object.fromEntries(Object.keys(allTransactionChanges).map((key) => [key, null]));
const errorFields = Object.fromEntries(Object.keys(allTransactionChanges).map((key) => [key, {[DateUtils.getMicroseconds()]: Localize.translateLocal('iou.error.genericEditFailureMessage')}])); Branch draft for this solution What alternative solutions did you explore? (Optional) |
Proposal Updated
|
@etCoderDysto's proposal LGTM - it's a nice and simple solution, and a pattern that we use elsewhere, e.g. here
I'm not aware of any other reason to specifically set the amount field as pending as the other two proposals have, so it seems much simpler to just rely on the field that's actually changed. 🎀👀🎀 C+ reviewed |
Hi @paultsimura, amount is not blank when editing waypoint followed by editing rate. It is only blank when editing waypoints. Screen.Recording.2024-08-11.at.1.50.33.in.the.afternoon.mp4 |
@etCoderDysto this should be fixed by #47145, we can hold for it. |
Sounds good to me. I will wait till the pr is merged to main |
@RachCHopkins Can you add a hold for #47145? Thanks! |
@johnmlee101, @jjcoffee, @RachCHopkins, @etCoderDysto Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Waiting for #47145 to be merged to main |
Confirming to remove the overdue label 😅 |
@etCoderDysto #47145 has been merged. Let's go! 🚀 |
Great! I will raise a PR soon. |
@johnmlee101 @jjcoffee @RachCHopkins @etCoderDysto 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! |
Sorry guys, missed this one - I'm a little swamped and not really watching closely unless I'm starred. |
@RachCHopkins No worries, we're just waiting on a PR from @etCoderDysto here! |
Note The production deploy automation failed: This should be on [HOLD for Payment 2024-09-06] according to #48035 prod deploy checklist, confirmed in https://expensify.slack.com/archives/C01GTK53T8Q/p1725051480370659?thread_ts=1725050431.962859&cid=C01GTK53T8Q. |
I think this issue is ready for payout. |
Regression Test Proposal
Do we agree 👍 or 👎 |
Payment Summary:
Upwork job here |
Contributor has been paid, the contract has been completed, and the Upwork post has been closed. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Issue found when validating #40021
Version Number: 9.0.17-0
Reproducible in staging?: y
Reproducible in production?: no, new feature
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers): applausetester+kh05081@applause.expensifail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:
Action Performed:
Precondition:
Expected Result:
Amount field should be grayed out because it is changed from the rate offline.
Actual Result:
Amount field is not grayed out when changing distance rate offline.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6563316_1722946380136.bandicam_2024-08-06_20-08-53-476.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @jjcoffeeThe text was updated successfully, but these errors were encountered: