-
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] - Disabled rate is not listed in the Rate list when it is still selected #46884
Comments
Triggered auto assignment to @iwiznia ( |
Triggered auto assignment to @dylanexpensify ( |
👋 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:
|
Edited by proposal-police: This proposal was edited at 2024-08-06 14:00:06 UTC. PR - #40021 I can raise PR if needed ProposalPlease re-state the problem that we are trying to solve in this issue.Distance rate which is selected but after disabling, not shown. What is the root cause of that problem?We are filtering the disabled rates when showing the rates list in selector. App/src/libs/DistanceRequestUtils.ts Lines 47 to 50 in 627ef1a
App/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx Lines 141 to 144 in 627ef1a
What changes do you think we should make in order to solve the problem?We shall pass true as second argument that will give us disabled rates as well and we will also pass enabled value. App/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx Lines 141 to 144 in 627ef1a
Once that is done - const sections = Object.values(rates).filter(rate => {
const isSelected = currentRateID ? currentRateID === rate.customUnitRateID : rate.name === CONST.CUSTOM_UNITS.DEFAULT_RATE
return isSelected || rate?.enabled
}).map((rate) => {
const rateForDisplay = DistanceRequestUtils.getRateForDisplay(rate.unit, rate.rate, rate.currency, translate, toLocaleDigit);
return {
text: rate.name ?? rateForDisplay,
alternateText: rate.name ? rateForDisplay : '',
keyForList: rate.customUnitRateID,
value: rate.customUnitRateID,
isSelected: currentRateID ? currentRateID === rate.customUnitRateID : rate.name === CONST.CUSTOM_UNITS.DEFAULT_RATE,
isDisabled: !rate.enabled
};
}); What alternative solutions did you explore? (Optional)demo - distance.rates.disabled.mp4 |
@neil-marcellini Are we planning to make it external? |
@dominictb Your proposal will be dismissed because you did not follow the proposal template. |
ProposalPlease re-state the problem that we are trying to solve in this issue.The disabled rate is not listed in the Rate list when it is still selected. What is the root cause of that problem?This logic: App/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx Lines 71 to 81 in 627ef1a
does not return the disable rate. What changes do you think we should make in order to solve the problem?In general, we need to make sure, when we disable rate
Details:
+function getMileageRates(policy: OnyxInputOrEntry<Policy>, includeDisabledRates = false, selectedRateID: string): Record<string, MileageRate> {
Object.entries(distanceUnit.rates).forEach(([rateID, rate]) => {
+ if (!includeDisabledRates && rate.enabled === false && selectedRateID !== rateID) {
return;
}
mileageRates[rateID] = {
...
+ enabled: rate.enabled,
};
});
}
in here instead.
Note: In this page, we not only use the
and
so rates data should be consistent whole the file.
What alternative solutions did you explore? (Optional) |
Job added to Upwork: https://www.upwork.com/jobs/~01113b3b52e50f7f4e |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav ( |
made external |
@iwiznia, @mananjadhav, @dylanexpensify Eep! 4 days overdue now. Issues have feelings too... |
|
Yes, I agree with @iwiznia points here.
App/src/libs/DistanceRequestUtils.ts Lines 42 to 61 in 72c8cf7
So I am not getting what we are achieving. cc @mananjadhav |
Also in selected proposal, root cause is not correct. We are not passing disabled values to component and the RCA mentions about the logic for creating list items. |
Ohhhhh, ok yeah, looking at those now I agree it is not needed
Got it, makes sense |
Like where? I'd think most places it is being used needs this logic and the ones that do not, can just not pass a selected value and the behavior would stay the same as now, no?
Not sure what you mean here |
Checking recent comments. |
I don't think any of the existing calls should break. We can even set that as optional param. I don't think we're modifying anything for |
about RCA? Also didn't get this point.
|
📣 @dominictb 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Working on this now! |
pending regression period |
This issue has not been updated in over 15 days. @iwiznia, @mananjadhav, @dylanexpensify, @dominictb eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
Should be ready for payment shortly. |
FYI you can check yourself by looking at the production branch. I think it was since I see your changes here |
Okay I should've clarified. I did see the changes in the production branch, was wondering about the payout date. @dylanexpensify can you please help with the payout info? I'll work on the checklist meanwhile. |
hmmm yeah, I am not sure. Maybe you can find the merge commit in the production branch? |
Correct me if I am wrong but we can use this release link to confirm this was deployed 2 weeks ago - https://github.com/Expensify/App/releases/tag/9.0.31-26 @dylanexpensify as for the checklist I think this was more of an edge case and hence I don't have a PR that I can pinpoint to. But I do feel we should add a regression test for this one. Regression Test Proposal
|
Payment summary: Contributor: @dominictb $250 via Upwork Please apply/request! |
payment sent in upwork @dominictb! |
$250 approved for @mananjadhav |
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: v9.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: n/a
Email or phone of affected tester (no customers): [email protected]
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:
The disabled rate will appear selected in the Rate list but grayed out (like Category and Tag when selected and disabled afterward).
Actual Result:
The disabled rate is not listed in the Rate list when it is still selected.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6563344_1722947953071.20240806_203405.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mananjadhavThe text was updated successfully, but these errors were encountered: