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.56k stars 2.9k forks source link

Xero - Selected Xero bank account is not highlighted with a green checkmark #52699

Open IuliiaHerets opened 1 hour ago

IuliiaHerets commented 1 hour 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.63-3 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5220818 Email or phone of affected tester (no customers): https://expensify.testrail.io/index.php?/tests/view/5220818 Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Accounting.
  3. Connect to Xero.
  4. After connecting to Xero, click Export.
  5. Click Xero bank account.

Expected Result:

The selected Xero bank account should be highlighted with a green checkmark.

Actual Result:

The selected Xero bank account is not highlighted with a green checkmark. It is only highlighted after manually selecting it.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/6f2b9613-002b-4e7f-aed5-6a009a2b1d32

View all open jobs on GitHub

melvin-bot[bot] commented 1 hour ago

Triggered auto assignment to @sakluger (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.

FitseTLT commented 1 hour ago

Edited by proposal-police: This proposal was edited at 2024-11-18 12:44:16 UTC.

Proposal

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

Xero - Selected Xero bank account is not highlighted with a green checkmark

What is the root cause of that problem?

We are setting the selected bank account to bankAccounts?.[0] as a backup when there is no bank account in policy?.connections?.xero?.data.bankAccounts that matches with exportConfiguration?.nonReimbursableAccount https://github.com/Expensify/App/blob/63c8dd2bb44deb2d62e223530fa0d734f1cfba5c/src/pages/workspace/accounting/xero/export/XeroExportConfigurationPage.tsx#L26 but we didn't give the same backup in the account select page here https://github.com/Expensify/App/blob/63c8dd2bb44deb2d62e223530fa0d734f1cfba5c/src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx#L31

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

We should give the same fallback value in.XeroBankAccountSelectPage.tsx, i.e.


    const {bankAccounts} = policy?.connections?.xero?.data ?? {};

    const xeroSelectorOptions = useMemo<SelectorType[]>(
        () => getXeroBankAccounts(policy ?? undefined, config?.export?.nonReimbursableAccount ?? bankAccounts?.[0]?.id),
        [config?.export?.nonReimbursableAccount, policy, bankAccounts],

What alternative solutions did you explore? (Optional)