Skip to content
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

Bank account - Workspace default currency becomes accessible after opening bank account RHP #38230

Closed
2 of 6 tasks
kbecciv opened this issue Mar 13, 2024 · 5 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kbecciv
Copy link

kbecciv commented Mar 13, 2024

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.51-3
Reproducible in staging?: y
Reproducible in production?: y
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com.
  2. Go to workspace settings > Free workspace > Bank account.
  3. Add a bank account.
  4. Refresh the page.
  5. Go to workspace profile > Currency.
  6. Note that Currency is not clickable.
  7. Click Bank account.
  8. Close the RHP.
  9. Go to workspace profile > Currency.

Expected Result:

The workspace currency list will not be accessible because a US bank account is added.

Actual Result:

The workspace currency list becomes accessible after reopening bank account when US bank account is added.

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6412229_1710334888914.bandicam_2024-03-13_20-34-03-031.mp4

View all open jobs on GitHub

@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

Triggered auto assignment to @MitchExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@kbecciv
Copy link
Author

kbecciv commented Mar 13, 2024

@MitchExpensify 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.

@allgandalf
Copy link
Contributor

Proposal

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

Workspace default currency becomes accessible after opening bank account RHP

What is the root cause of that problem?

We don't define hasVBA according to the state of the reimbursementAccount

<MenuItemWithTopDescription
title={formattedCurrency}
description={translate('workspace.editor.currencyInputLabel')}
shouldShowRightIcon={!readOnly}
disabled={hasVBA ? true : readOnly}

The current definition is:

{(hasVBA?: boolean) => (

For the very first time hasVBA is set to true when we open workspace settings, but when we open the Bank Account RHP, it is set to false as we lose focus from the page.

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

We need to have a define hasVBA which remains true if the state of the bank account is set to open

const hasVBA = state === BankAccount.STATE.OPEN;

We need to update the WorkSpaceProfilePageOnyxProps to include

reimbursementAccount: OnyxEntry<ReimbursementAccount>;

Then we need to get state:

const { state} = reimbursementAccount?.achData ?? {};

We already do this in Workflows:

const {accountNumber, state, bankName} = reimbursementAccount?.achData ?? {};
const hasVBA = state === BankAccount.STATE.OPEN;

The condition to disable currency will still remain unaffected

What alternative solutions did you explore? (Optional)

N/A

@bernhardoj
Copy link
Contributor

Same issue as #36376

@MitchExpensify
Copy link
Contributor

Closing because dupe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

4 participants