Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.54k stars 2.88k forks source link

[HOLD for payment 2024-08-19] [$250] iOS - Taxes - Unable to select Foreign currency default via checkbox #46657

Closed lanitochka17 closed 2 months ago

lanitochka17 commented 3 months ago

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.15-4 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4801379 Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Taxes
  3. Tap Settings
  4. Tap Foreign currency default
  5. Select another tax that is not Workspace currency default as Foreign currency default
  6. Return to tax list
  7. Long press on the Foreign currency default
  8. Tap Select
  9. Tap on the checkbox next to Foreign currency default
  10. Note that Foreign currency default cannot be selected via the checkbox
  11. Tap Select all checkbox
  12. Note that Foreign currency default can be selected via Select all checkbox

Expected Result:

In Step 10, user should be able to select Foreign currency default via the checkbox (production behavior).\

Actual Result:

In Step 10, user is unable to select Foreign currency default via the checkbox However, it can be selected via Select all checkbox (Step 12)

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/4f7d2c88-9343-4b35-83cb-94f4d3d8cef8

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019b20d5176ab3a33e
  • Upwork Job ID: 1820468883128659309
  • Last Price Increase: 2024-08-05
  • Automatic offers:
    • ahmedGaber93 | Reviewer | 103414421
Issue OwnerCurrent Issue Owner: @zanyrenney
melvin-bot[bot] commented 3 months ago

Triggered auto assignment to @Julesssss (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

github-actions[bot] commented 3 months ago

:wave: 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:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
lanitochka17 commented 3 months ago

We think that this bug might be related to #wave-collect - Release 1

melvin-bot[bot] commented 3 months ago

Triggered auto assignment to @zanyrenney (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

Julesssss commented 3 months ago

Minor issue, not going to block release

bernhardoj commented 3 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Can't select the default foreign currency by toggling the checkbox.

What is the root cause of that problem?

When pressing the checkbox, it will do nothing if the tax is the workspace currency default or foreign currency default. https://github.com/Expensify/App/blob/e0f17df84a677c6a6cc412e0fa132782d5df700c/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx#L126-L130

We already disable the checkbox here if we can't delete the tax. https://github.com/Expensify/App/blob/e0f17df84a677c6a6cc412e0fa132782d5df700c/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx#L115 https://github.com/Expensify/App/blob/e0f17df84a677c6a6cc412e0fa132782d5df700c/src/libs/PolicyUtils.ts#L416-L418

However, canEditTaxRate only checks for workspace currency default.

Also, when we toggle select all checkbox, we already filter out workspace currency default tax, but not for foreign currency default. https://github.com/Expensify/App/blob/e0f17df84a677c6a6cc412e0fa132782d5df700c/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx#L140-L141

What changes do you think we should make in order to solve the problem?

Update PolicyUtils.canEditTaxRate and select all logic to check for foreign currency default too.

function canEditTaxRate(policy: Policy, taxID: string): boolean {
    return policy.taxRates?.defaultExternalID !== taxID && policy.taxRates?.foreignTaxDefault !== taxID;
}
const taxesToSelect = taxesList.filter((tax) => tax.keyForList !== defaultExternalID && tax.keyForList !== foreignTaxDefault && ...);

What alternative solutions did you explore? (Optional)

Allow user to toggle foreign currency default tax by removing key === foreignTaxDefault https://github.com/Expensify/App/blob/55a29dd95d9753be05ddab40c79b79186ce05453/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx#L126-L130

melvin-bot[bot] commented 3 months ago

Job added to Upwork: https://www.upwork.com/jobs/~019b20d5176ab3a33e

melvin-bot[bot] commented 3 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 (External)

ahmedGaber93 commented 3 months ago

@bernhardoj's proposal LGTM!

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

melvin-bot[bot] commented 3 months ago

Current assignee @Julesssss is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] commented 3 months ago

πŸ“£ @ahmedGaber93 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

bernhardoj commented 3 months ago

PR is ready

cc: @ahmedGaber93

melvin-bot[bot] commented 2 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 2 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.18-10 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-08-19. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 2 months ago

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:

zanyrenney commented 2 months ago

waiting for 7 days.

ahmedGaber93 commented 2 months ago

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:

Regression Test Proposal

  1. Open workspace tax page
  2. Make sure you have more than 2 taxes
  3. Open the tax settings and set the workspace currency default and foreign currency default (should be different tax selected)
  4. Try to select taxes and verify the checkbox of the workspace currency default and foreign currency default taxes are disabled
  5. Press the Select all checkbox
  6. Verify all non-default taxes are selected

Do we agree πŸ‘ or πŸ‘Ž

zanyrenney commented 2 months ago

https://github.com/Expensify/App/issues/47636

zanyrenney commented 2 months ago

payment summary

@ahmedGaber93 requires payment automatic offer (Reviewer) - paid $250 via upwork @bernhardoj requires payment through NewDot Manual Requests - owed $250, please request via ND.

Thanks!

bernhardoj commented 2 months ago

Requested in ND.

JmillsExpensify commented 2 months ago

$250 approved for @bernhardoj