-
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
[HOLD for payment 2024-06-13] [$250] Distance rate can be deleted from 3-dot menu when there is only one rate #41594
Comments
Triggered auto assignment to @slafortune ( |
@slafortune FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
We think that this bug might be related to #wave-collect - Release 1 |
Job added to Upwork: https://www.upwork.com/jobs/~0144c3fd2f5960b3c2 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Distance rate can be deleted from 3-dot menu when there is only one rate What is the root cause of that problem?The condition
What changes do you think we should make in order to solve the problem?Remove Optionally, we can filter out as stated above without removing Also check for other policy pages that has similar functionality What alternative solutions did you explore? (Optional)Only change the |
Proposal Upadated
|
Proposal Upadated
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Users can delete all distance rate What is the root cause of that problem?
We don't filter out the distance rate with a pendingAction of DELETE What changes do you think we should make in order to solve the problem?See the logic in PolicyDistanceRatesPage, It works well App/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx Lines 66 to 68 in 387ab0e
To ensure consistency, we should implement the same solution for PolicyDistanceRatesPage: (but using the current rate instead of selectedDistanceRates)
Moreover, creating a utility function could help maintain a DRY (Don't Repeat Yourself) codebase. 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. |
ProposalPlease re-state the problem that we are trying to solve in this issue.User is able to delete ALL distance rates when application is offline. Expected scenario is that there should be at-least one distance rate and user should NOT be allowed to delete the last remaining distance rate. What is the root cause of that problem?Let's assume that there are N distance rates in the list. Since the user is offline, when the user deletes one of the rates, it become's "disabled" but internally it is still considered to be "enabled". Hence, this condition:
More specifically:
continues to have a value of N and not N - 1. Because of this, when the user attempt's to delete the last rate, since the value of the above condition is still N, What changes do you think we should make in order to solve the problem?set App/src/libs/actions/Policy.ts Lines 4792 to 4808 in 951c7b3
What alternative solutions did you explore? (Optional)Option 2:
Option 3:
The problem with the above approaches however is that it does not solve the root of the problem, i.e setting the |
@slafortune, @sobitneupane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Will review the proposals shortly. |
Thanks for the proposal everyone. All the proposals are almost same. @Krishna2323 Your proposal needs few refinement. Can you please separate all the options as different solutions in your proposal. You can take this proposal as an example. Why should we remove pending action |
Thanks for the proposal @cretadn22 Your proposal looks good to be. Instead of
🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @tgolen, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@sobitneupane, isn't @cretadn22's proposal same as mine with small refactor? |
@Krishna2323 I would say your proposal is rather unclear. You have added multiple things in one place, many of which seem unnecessary. |
@sobitneupane, I think this is pretty clear, I mentioned about removing I try to provide solutions for various scenarios because I've encountered situations where the expected outcome changed during discussions, and those who were actively involved at the time took advantage of that. cc: @tgolen |
Triggered auto assignment to @kevinksullivan ( |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.79-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-06-13. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@cretadn22 Paid ✔️ |
@tgolen, @slafortune, @sobitneupane, @cretadn22 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
bump @sobitneupane to complete the checklist, please. |
Regression Test Proposal
Do we agree 👍 or 👎 |
yes
|
@sobitneupane C+ is due $250 via NewDot |
$250 approved for @sobitneupane |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.70-0
Reproducible in staging?: Yes
Reproducible in production?: No
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: Applause Internal Team
Slack conversation:
Action Performed:
Precondition:
Expected Result:
App will show the same pop-up in Step 9 that the distance rate cannot be deleted as there is only one distance rate.
Actual Result:
Distance rate can be deleted from 3-dot menu when there is only one distance rate.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6470164_1714748306876.bandicam_2024-05-03_22-51-33-950.mp4
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @sobitneupane / @kevinksullivanThe text was updated successfully, but these errors were encountered: