-
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-11-29] [$250] Tax - Enable/disable option shows rates text in plural instead rate #51017
Comments
Triggered auto assignment to @isabelastisser ( |
@isabelastisser 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 |
rzghnsy Your proposal will be dismissed because you did not follow the proposal template. |
Edited by proposal-police: This proposal was edited at 2024-10-17 13:37:10 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Tax - Enable/disable option shows rates text in plural instead rate What is the root cause of that problem?We show plural text base on
What changes do you think we should make in order to solve the problem?Create new variables to check is there multiple enabled tax selected and is there multiple disabled tax selected
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Enable/disable option shows rates text in plural instead rate What is the root cause of that problem?Here we only see if selected tags are more than 1 instead of checking disable/enable tags count
What changes do you think we should make in order to solve the problem?We can create 2 new variables
and then in here we can check
and in here we can change this to
We can do same for enable tags What alternative solutions did you explore? (Optional) |
Edited by proposal-police: This proposal was edited at 2024-10-17 13:57:28 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Tax - Enable/disable option shows rates text in plural instead rate What is the root cause of that problem?Irrespective of number of available rates to enable/disable, we check only for number of selections here.
What changes do you think we should make in order to solve the problem?Rather create new objects const enbledRates = selectedTaxesIDs.filter((taxID) => policy?.taxRates?.taxes[taxID]?.isDisabled);
const disabledRates = selectedTaxesIDs.filter((taxID) => !policy?.taxRates?.taxes[taxID]?.isDisabled); now use if (enabledRates?.length) {
and use enabledRates?.length > 1 instead of isMultiple here
Similar for Enable option use 'disabledRates?.length' here. if (disabledRates?.length) {
And use disabledRates?.length > 1 instead of isMultiple here.
This way we optimize the solution and do not have to filter array twice. What alternative solutions did you explore? (Optional)And since we make use of this logic only to determine length of selections, we could optimize it further. Only create 1 object which holds count of enabled selections and use it to determine length of disabledSelectionCount. const enabledRatesCount = selectedTaxesIDs.filter((taxID) => !policy?.taxRates?.taxes[taxID]?.isDisabled).length;
const disabledRatesCount = selectedTaxesIDs.length - enabledRatesCount; and use those variables for check here
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. |
Updated Proposal |
ProposalPlease re-state the problem that we are trying to solve in this issue.Enable/disable option shows rates text in plural instead rate What is the root cause of that problem?We check if multiple are selected:
If so then without checking if there are multiple selected or not, we directly show plural form of texts:
What changes do you think we should make in order to solve the problem?First we need to get the disabled and enabled taxes: const enabledRatesCount = selectedTaxesIDs.filter((taxID) => !policy?.taxRates?.taxes[taxID]?.isDisabled).length;
const disabledRatesCount = selectedTaxesIDs.length - enabledRatesCount; Now according to our Readme:
So we should not do condition rendering here, instead we should update the text to match this plural forms: First update the en.ts and es.ts file to unify the multi tags messages: disableTaxTitle: () => ({
one: 'Disable rate',
other: 'Disable rates',
}),
enableTaxTitle: () => ({
one: 'enable rate',
other: 'enable rates',
}),
// `Disable rates` when at least one enabled rate is selected.
if (selectedTaxesIDs.some((taxID) => !policy?.taxRates?.taxes[taxID]?.isDisabled)) {
options.push({
icon: Expensicons.DocumentSlash,
text: translate('workspace.taxes.actions.disableTaxTitle', {count: disabledRatesCount}),
value: CONST.POLICY.BULK_ACTION_TYPES.DISABLE,
onSelected: () => toggleTaxes(false),
});
}
// `Enable rates` when at least one disabled rate is selected.
if (selectedTaxesIDs.some((taxID) => policy?.taxRates?.taxes[taxID]?.isDisabled)) {
options.push({
icon: Expensicons.Document,
text: translate('workspace.taxes.actions.enableTaxTitle', {count: enabledRatesCount}),
value: CONST.POLICY.BULK_ACTION_TYPES.ENABLE,
onSelected: () => toggleTaxes(true),
});
} We can even optimise the conditions during PR phase What alternative solutions did you explore? (Optional) |
Job added to Upwork: https://www.upwork.com/jobs/~021846961178055724837 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha ( |
@isabelastisser, @getusha Huh... This is 4 days overdue. Who can take care of this? |
@getusha, can you please review the proposals above and provide an update? Thanks! |
Bump @getusha for an update, thanks! |
Reviewing |
there are 3 cases we need to handle
|
Triggered auto assignment to @techievivek, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Not sure if this is worth fixing though @techievivek what do you think? |
@getusha , this is supposed to be fixed, we recently fixed a similar issue on members page as well: c.c. @techievivek |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@twilight2294 @getusha, to clarify, is this issue fixed? |
📣 @twilight2294 You have been assigned to this job! |
I applied for the job on upwork, PR will be ready in few hours |
PR ready for review c.c. @getusha |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.65-5 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-11-29. 🎊 For reference, here are some details about the assignees on this issue:
|
@getusha @isabelastisser @getusha The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
Payment Summary
BugZero Checklist (@isabelastisser)
|
@isabelastisser, @techievivek, @getusha, @twilight2294 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@isabelastisser can you pay me for this issue ? |
I was OOO last week, I will review this today. |
@getusha, do we need a regression test? |
Payment summary: Reviewer: @getusha owed $250 via NewDot C+ |
@getusha confirmed via DM that we don't need a regression test. all set! |
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: 9. 0.50-0
Reproducible in staging?: Y
Reproducible in production?: Y
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: N/A
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Enable/disable option must not show rates text in plural and it must show rate
Actual Result:
Enable/disable option shows rates text in plural instead rate when only one enabled and disabled rate are selected
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6637276_1729142094339.rate.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @getushaThe text was updated successfully, but these errors were encountered: