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.89k forks source link

[$500] Android - Wallet - Expensify terms of service checkbox is not shown when adding BA using Enable Wallet #32407

Closed kbecciv closed 11 months ago

kbecciv commented 11 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: 1.4.7-0 Reproducible in staging?: y Reproducible in production?: cannot check production If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:

Action Performed:

  1. Launch app
  2. Tap profile icon
  3. Tap Wallet
  4. Tap "Enable Wallet"
  5. Tap continue and select Bank "chase"
  6. Tap continue to login
  7. Enter the credentials and complete the flow selecting "plaid saving ending 1111"
  8. In Add Bank account page, note no message under under "plaid saving 1111"

Expected Result:

Expensify terms of service checkbox must be displayed when adding Bank account using "Enable wallet"

Actual Result:

Expensify terms of service checkbox is not displayed when adding Bank account using "Enable wallet"

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/93399543/3ba1ea20-7f22-471b-a0a6-fcc81e53edb8

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d1378f851b3082b9
  • Upwork Job ID: 1731744794475872256
  • Last Price Increase: 2023-12-11
Issue OwnerCurrent Issue Owner: @pecanoro
github-actions[bot] commented 11 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.
melvin-bot[bot] commented 11 months ago

Triggered auto assignment to @pecanoro (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

bernhardoj commented 11 months ago

Proposal

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

The add bank account page from "Enable Wallet" button doesn't show a terms of service checkbox which is different from the add bank account page from the workspace bank account.

What is the root cause of that problem?

The add bank account page from "Enable Wallet" component is AddPersonalBankAccountPage. I think we never have a terms of service checkbox in that component.

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

If we want to add it, we can add it like in BankAccountPlaidStep,

{Boolean(selectedPlaidAccountID) && !_.isEmpty(lodashGet(plaidData, 'bankAccounts')) && (
    <InputWrapper
        InputComponent={CheckboxWithLabel}
        accessibilityLabel={`${translate('common.iAcceptThe')} ${translate('common.expensifyTermsOfService')}`}
        style={styles.mt4}
        inputID="acceptTerms"
        LabelComponent={() => (
            <Text>
                {translate('common.iAcceptThe')}
                <TextLink href={CONST.TERMS_URL}>{translate('common.expensifyTermsOfService')}</TextLink>
            </Text>
        )}
    />
)}

and add a validation for the checkbox just like in BankAccountPlaidStep too. https://github.com/Expensify/App/blob/1682be47d71b5a84c20c2396e833c0a015829252/src/pages/ReimbursementAccount/BankAccountPlaidStep.js#L49-L56

pecanoro commented 11 months ago

Not a deploy blocker since this has never existed in the component.

melvin-bot[bot] commented 11 months ago

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

melvin-bot[bot] commented 11 months ago

Bug0 Triage Checklist (Main S/O)

melvin-bot[bot] commented 11 months ago

Current assignee @garrettmknight is eligible for the NewFeature assigner, not assigning anyone new.

pecanoro commented 11 months ago

Not a bug, I forgot the NewFeature one also adds a BZ member.

pecanoro commented 11 months ago

Ok, so after discussion, we do want to add the checkbox but we need to make sure we are sending the data to the back-end the same way we do when adding a business account!

melvin-bot[bot] commented 11 months ago

Job added to Upwork: https://www.upwork.com/jobs/~01d1378f851b3082b9

melvin-bot[bot] commented 11 months ago

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

melvin-bot[bot] commented 11 months ago

📣 @postonsundays! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
happy-devs commented 11 months ago

Proposal

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

The Expensify terms of service checkbox is not shown when trying to add a personal bank account using Enable Wallet.

What is the root cause of that problem?

A checkbox with the terms of service label does not currently exist in the AddPersonalBankAccountPage user flow.

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

As @bernhardoj mentioned, inserting an InputWrapper component as the first child of the FormProvider component and similar validation to the BankAccountPlaidStep is enough to prompt user confirmation.

The following changes to https://github.com/Expensify/App/blob/6dbaa4a7ac8c8142a452bf2a059a16b2947616c9/src/pages/AddPersonalBankAccountPage.js#L64`:

LINE 64:

const shouldShowTOS = Boolean(selectedPlaidAccountId) && !_.isEmpty(lodashGet(plaidData, 'bankAccounts'));

LINE 69:

const validateBankAccountForm = useCallback((values) => {
        const errorFields = {};
        if (!values.acceptTerms) {
            errorFields.acceptTerms = 'common.error.acceptTerms';
        }

        return errorFields;
    }, []);

LINE 117:

<FormProvider
                    formID={ONYXKEYS.PERSONAL_BANK_ACCOUNT}
                    isSubmitButtonVisible={Boolean(selectedPlaidAccountId)}
                    submitButtonText={translate('common.saveAndContinue')}
                    scrollContextEnabled
                    onSubmit={submitBankAccountForm}
                    validate={validateBankAccountForm}
                    style={[styles.mh5, styles.flex1]}
                >
                    {shouldShowTOS && <InputWrapper
                        InputComponent={CheckboxWithLabel}
                        accessibilityLabel={`${translate('common.iAcceptThe')} ${translate('common.expensifyTermsOfService')}`}
                        style={styles.mt4}
                        inputID="acceptTerms"
                        LabelComponent={() => (
                            <Text>
                                {translate('common.iAcceptThe')}
                                <TextLink href={CONST.TERMS_URL}>{translate('common.expensifyTermsOfService')}</TextLink>
                            </Text>
                        )}
                    />}

It's unclear where the code to add a business account is as @pecanoro mentioned to compare how we are currently sending the data to the back-end, but as the proposed checkbox is only a confirmation step this should not affect the current flow.

melvin-bot[bot] commented 11 months ago

📣 @happy-devs! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
happy-devs commented 11 months ago

Contributor details Your Expensify account email: andrew@happysoft.dev Upwork Profile Link: https://www.upwork.com/en-gb/freelancers/happysoft

melvin-bot[bot] commented 11 months ago

⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.

melvin-bot[bot] commented 11 months ago

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

happy-devs commented 11 months ago

Contributor details Your Expensify account email: andrew@happysoft.dev Upwork Profile Link: [upwork.com/en-gb/freelancers/happysoft](https://www.upwork.com/en-gb/freelancers/happysoft)

melvin-bot[bot] commented 11 months ago

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

bernhardoj commented 11 months ago

we need to make sure we are sending the data to the back-end the same way we do when adding a business account!

@pecanoro what should be the parameter name for the checkbox value?

Looking at the add business bank account API, we don't send the checkbox value (and I think it's gonna always be true).

https://github.com/Expensify/App/blob/1116f0f822730d14d13a5c51a49ea17eff5490bd/src/libs/actions/BankAccounts.ts#L125-L147

garrettmknight commented 11 months ago

@pecanoro starring you while we wait for your answer.

pecanoro commented 11 months ago

When looking into this I realized that we have something similar to accept the terms when enabling the wallet so I am double-checking in Slack to see of that is enough or we should add it again here.

melvin-bot[bot] commented 11 months ago

@garrettmknight, @akinwale, @pecanoro Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] commented 11 months ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] commented 11 months ago

@garrettmknight, @akinwale, @pecanoro Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] commented 11 months ago

@garrettmknight, @akinwale, @pecanoro 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

pecanoro commented 11 months ago

So it seems there is checkbox already for the wallet so we don't need one in this flow:

image (1)