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

Refactor requestor step form #12766

Merged
merged 14 commits into from
Nov 22, 2022

Conversation

mollfpr
Copy link
Contributor

@mollfpr mollfpr commented Nov 16, 2022

Details

Refactor the personal information form (Requestor Step Form) to use Form.js.

Fixed Issues

$ #9581
$ #9581 (comment)

Tests

  1. Open an Expensify account
  2. Go to settings page > workspaces page and select a workspace > click on Connect bank account menu
  3. Click on Connect manually
  4. Fill up the bank account form
  5. Fill up the company information form and go to the personal information form
  • UI looks as it did before the refactor

  • Values can be added and edited

  • Errors are highlighted correctly (input border)

  • Error messages show up correctly

  • Draft values are saved properly

  • Form alerts are displayed correctly

  • Clicking the fix the errors link focuses the first input with error

  • No duplicate submission of the form occurs (when it's already submitting)

  • Verify that no errors appear in the JS console

Offline tests

  1. Open an Expensify account
  2. Go to settings page > workspaces page and select a workspace > click on Connect bank account menu
  3. Click on Connect manually
  4. Fill up the bank account form
  5. Fill up the company information form and go to the personal information form
  6. Verified that the form can't be submit and the button is disabled

QA Steps

  1. Open an Expensify account
  2. Go to settings page > workspaces page and select a workspace > click on Connect bank account menu
  3. Click on Connect manually
  4. Fill up the bank account form
  5. Fill up the company information form and go to the personal information form
  • UI looks as it did before the refactor

  • Values can be added and edited

  • Errors are highlighted correctly (input border)

  • Error messages show up correctly

  • Draft values are saved properly

  • Form alerts are displayed correctly

  • Clicking the fix the errors link focuses the first input with error

  • No duplicate submission of the form occurs (when it's already submitting)

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above

  • I wrote clear testing steps that cover the changes made in this PR

    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms

  • I ran the tests on all platforms & verified they passed on:

    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)

  • I followed proper code patterns (see Reviewing the code)

    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers

  • I followed the guidelines as stated in the Review Guidelines

  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)

  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)

  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such

  • If a new component is created I verified that:

    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:

    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)

  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.

  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

PR Reviewer Checklist

The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for expected offline behavior are in the Offline steps section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots

Web

12766.Web.mov

Mobile Web - Chrome

12766.mWeb-Chrome.mov

Mobile Web - Safari

12766.mWeb-Safari.mov

Desktop

12766.Desktop.mov

iOS

12766.iOS.mov

Android

12766.Android.mov

@mollfpr mollfpr marked this pull request as ready for review November 16, 2022 19:17
@mollfpr mollfpr requested a review from a team as a code owner November 16, 2022 19:17
@melvin-bot melvin-bot bot requested review from neil-marcellini and Santhosh-Sellavel and removed request for a team November 16, 2022 19:18
@melvin-bot
Copy link

melvin-bot bot commented Nov 16, 2022

@neil-marcellini @Santhosh-Sellavel One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

Comment on lines 256 to 233
<Text
onPress={() => Link.openExternalLink('https://onfido.com/privacy/')}
style={[styles.textMicro, styles.link]}
accessibilityRole="link"
>
<Text onPress={() => Link.openExternalLink('https://onfido.com/privacy/')} style={[styles.textMicro, styles.link]} accessibilityRole="link">
{`${this.props.translate('common.privacyPolicy')}`}
</Text>
{` ${this.props.translate('common.and')} `}
<Text
onPress={() => Link.openExternalLink('https://onfido.com/terms-of-service/')}
style={[styles.textMicro, styles.link]}
accessibilityRole="link"
>
<Text onPress={() => Link.openExternalLink('https://onfido.com/terms-of-service/')} style={[styles.textMicro, styles.link]} accessibilityRole="link">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the unnecessary format changes

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Nov 17, 2022

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Desktop & Web
Screen.Recording.2022-11-17.at.9.31.57.PM.mov
Mobile Web - Chrome
Android_mWEb.mov
Mobile Web - Safari
iOS.mWEb.mov
iOS & Android
Screen.Recording.2022-11-17.at.9.40.11.PM.mov

@Santhosh-Sellavel
Copy link
Collaborator

@mollfpr Can you update the test steps more clearly, can add steps on how to navigate to connect bank account.

UI looks as it did before the refactor

Values can be added and edited

Errors are highlighted correctly (input border)

Error messages show up correctly

Draft values are saved properly

Form alerts are displayed correctly

Clicking the fix the errors link focuses the first input with error

No duplicate submission of the form occurs (when it's already submitting)

And these could be listed as a checklist

Ex:

  • Errors are highlighted correctly (input border)

@mollfpr
Copy link
Contributor Author

mollfpr commented Nov 17, 2022

Updated test steps! @Santhosh-Sellavel

@Santhosh-Sellavel
Copy link
Collaborator

@neil-marcellini

I noticed the following issues while testing

Warning

Same one I found here, forgot to report in slack will do this

Date Picker is not resettable (Not relevant to this issue)

  • iOS & iOS mWeb
  • Android

Date Picker icon is not centered in Desktop & Web

Screenshot 2022-11-17 at 11 17 31 PM

State Picker Focus is not visible/conveyed to the user (Accessibility Issue)

In the error view, clicking fix the errors focus set it to State Picker is unnoticeable.

Copy link
Collaborator

@Santhosh-Sellavel Santhosh-Sellavel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neil-marcellini Looks good to me.

I found a few issues, nothing was introduced here, so approving this one.

@Santhosh-Sellavel
Copy link
Collaborator

Also, let me know if should I raise those issues in slack and which issues if you want to ignore any let me know, thanks!

@neil-marcellini
Copy link
Contributor

I'm reviewing now 👀. I may be a bit slow since I want to be cautious.


// Prepare inputKeys for clearing errors
const inputKeys = _.keys(values);
if (!values.firstName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to trim the value first. Right now I can enter a space as my first name and it works. I didn't catch this in the proposal review but I noticed this because previously we used ValidationUtils.isRequiredFulfilled here.

if (isRequiredFulfilled(identity[fieldName])) {

We should probably use that method. The same problem occurs for the last name, street, city, and maybe others.

Screen.Recording.2022-11-17.at.10.43.19.AM.mov

Copy link
Contributor

@neil-marcellini neil-marcellini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is looking really good. There are a few tweaks needed. Please let me know when it's updated.

src/pages/ReimbursementAccount/RequestorStep.js Outdated Show resolved Hide resolved
src/languages/en.js Outdated Show resolved Hide resolved
src/languages/es.js Outdated Show resolved Hide resolved
@neil-marcellini
Copy link
Contributor

@Santhosh-Sellavel all of the bugs you mentioned here #12766 (comment) also exist on staging or prod correct?

If so please report them.

@mollfpr
Copy link
Contributor Author

mollfpr commented Nov 18, 2022

Updated PR @Santhosh-Sellavel @neil-marcellini

Copy link
Contributor

@neil-marcellini neil-marcellini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your latest batch of changes look good. I will test thoroughly on web now and leave any comments if needed. If it all goes well I'll approve.

@neil-marcellini
Copy link
Contributor

Tests

  1. Open an Expensify account
  2. Go to settings page > workspaces page and select a workspace > click on Connect bank account menu
  3. Click on Connect manually
  4. Fill up the bank account form
  5. Fill up the company information form and go to the personal information form
  • UI looks as it did before the refactor
    Before
    image

After
image

  • Values can be added and edited
    @mollfpr There is a bug introduced by this PR where you need to click twice on the address item to populate it. On staging it only takes one click.
    This PR
this-pr.mov

Staging

staging.mov
  • Errors are highlighted correctly (input border)

  • Error messages show up correctly

  • Draft values are saved properly

  • Form alerts are displayed correctly

  • Clicking the fix the errors link focuses the first input with error

  • No duplicate submission of the form occurs (when it's already submitting)

  • Verify that no errors appear in the JS console

@mollfpr
Copy link
Contributor Author

mollfpr commented Nov 19, 2022

@neil-marcellini Yeah, I notice that too I put a heads-up in here #9581 (comment)

Should we put the fix in this PR or log it into another issue?

@Santhosh-Sellavel
Copy link
Collaborator

@neil-marcellini Yeah, I notice that too I put a heads-up in here #9581 (comment)

Should we put the fix in this PR or log it into another issue?

If this is not introduced here, we should log an issue. If not fix it here!

@mollfpr
Copy link
Contributor Author

mollfpr commented Nov 21, 2022

It's reproducible on staging. Go to Settings > Payments > Debit card and type a text in the billing address input and select the option. @neil-marcellini @Santhosh-Sellavel

Screen.Recording.2022-11-21.at.22.22.48.mov

@Santhosh-Sellavel
Copy link
Collaborator

It's reproducible on staging. Go to Settings > Payments > Debit card and type a text in the billing address input and select the option. @neil-marcellini @Santhosh-Sellavel

Screen.Recording.2022-11-21.at.22.22.48.mov

Check you on the same form we are refactoring here!

@mollfpr
Copy link
Contributor Author

mollfpr commented Nov 21, 2022

Okay, I found the cause of AddressSearch option is not selectable on the first try. In the Form.js the onBlur validation makes the component rerender even though the values nor the errors are not changing. It's affecting the AddressSearch because before clicking the option, the focus is moved to BODY where it should stay on the input.

diff --git a/src/components/Form.js b/src/components/Form.js
index b7b5f72ed..14f46e9ca 100644
--- a/src/components/Form.js
+++ b/src/components/Form.js
@@ -78,6 +78,14 @@ class Form extends React.Component {
         this.submit = this.submit.bind(this);
     }

+    shouldComponentUpdate(nextProps, nextState) {
+        if (_.isEqual(nextState.inputValues, this.state.inputValues) && _.isEqual(nextState.errors, this.state.errors)) {
+            return false;
+        }
+
+        return true;
+    }
+
     /**
      * @param {String} inputID - The inputID of the input being touched
      */
Screen.Recording.2022-11-21.at.23.15.52.mov

@neil-marcellini
Copy link
Contributor

neil-marcellini commented Nov 21, 2022

@mollfpr Thanks for doing some investigation. Even though the same error exists on staging, it is on another form, so I don't want to introduce another regression in another place. Let's fix it in this PR.

It's affecting the AddressSearch because before clicking the option, the focus is moved to BODY where it should stay on the input.

Why is the focus moved to the body before clicking the option? Is that the intended behavior? What happens on staging? Are you sure there won't be any problems caused by preventing the form component from updating if values and errors stay the same?

@mollfpr
Copy link
Contributor Author

mollfpr commented Nov 22, 2022

Why is the focus moved to the body before clicking the option?

When clicking the option, the onBlur is called, check the validation and set the errors to the Form.js state. Because of that the Form.js is rerendered and makes the AddressSearch input lose focus.

Is that the intended behavior?

Is not.

What happens on staging?

Same as here, in AddDebitCardPage, is using AddressSearch inside the Form.js component.

Are you sure there won't be any problems caused by preventing the form component from updating if values and errors stay the same?

I believe is not, because the input is changed only due to the input value change or there's an error.


The simple solution we can do is when validate function is called, we check if the errors state is worth updating by checking against the new errors from the form page.

diff --git a/src/components/Form.js b/src/components/Form.js
index b7b5f72ed..5bdf994ba 100644
--- a/src/components/Form.js
+++ b/src/components/Form.js
@@ -125,7 +125,11 @@ class Form extends React.Component {
         const errors = _.pick(validationErrors, (inputValue, inputID) => (
             Boolean(this.touchedInputs[inputID])
         ));
-        this.setState({errors});
+
+        if (!_.isEqual(errors, this.state.errors)) {
+            this.setState({errors});
+        }
+
         return errors;
     }
Screen.Recording.2022-11-22.at.20.54.25.mov

@mollfpr
Copy link
Contributor Author

mollfpr commented Nov 22, 2022

The above fix will also fix any other form page using AddressSearch inside Form.js.

cc @neil-marcellini

@neil-marcellini
Copy link
Contributor

Thanks @mollfpr, I like the solution you outlined here #12766 (comment) better. Please commit that and I'll test again.

@neil-marcellini
Copy link
Contributor

I'll make that commit myself locally and start testing now so we can get this moving forward.

@mollfpr
Copy link
Contributor Author

mollfpr commented Nov 22, 2022

Updated @neil-marcellini

Copy link
Contributor

@neil-marcellini neil-marcellini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update the max zip code length to 10 digits.

ZIP_CODE: 5,

Maybe also add the hint here

maxLength={CONST.BANK_ACCOUNT.MAX_LENGTH.ZIP_CODE}

@neil-marcellini
Copy link
Contributor

Tests

  1. Open an Expensify account
  2. Go to settings page > workspaces page and select a workspace > click on Connect bank account menu
  3. Click on Connect manually
  4. Fill up the bank account form
  5. Fill up the company information form and go to the personal information form
  • UI looks as it did before the refactor
    Before
    image

After
image

  • Values can be added and edited
  • Errors are highlighted correctly (input border)
  • Error messages show up correctly
edit.mov
  • Draft values are saved properly
draft.mov
  • Form alerts are displayed correctly
  • Clicking the fix the errors link focuses the first input with error
fix-errors.mov
  • No duplicate submission of the form occurs (when it's already submitting)
no-duplicate.mov
  • Verify that no errors appear in the JS console

@neil-marcellini
Copy link
Contributor

@mollfpr please update the zip code length and then I think it's good to go.

@mollfpr
Copy link
Contributor Author

mollfpr commented Nov 22, 2022

@neil-marcellini Updated zip code

Copy link
Contributor

@neil-marcellini neil-marcellini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good to go! @Santhosh-Sellavel tested on all platforms earlier and the changes since then have not been substantial. Great work @mollfpr.

Here's the offline test since I missed it earlier:
Screenshot 2022-11-22 at 10 50 12 AM

@neil-marcellini neil-marcellini merged commit da8ffb2 into Expensify:main Nov 22, 2022
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @neil-marcellini in version: 1.2.31-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@luacmartins
Copy link
Contributor

The production deploy comment failed for this PR, but this was deployed to production on v1.2.32-2 on Nov 28.

onChangeText={value => props.onFieldChange({zipCode: value})}
errorText={props.errors.zipCode ? props.translate('bankAccount.error.zipCode') : ''}
maxLength={CONST.BANK_ACCOUNT.MAX_LENGTH.ZIP_CODE}
hint={props.translate('common.zipCodeExample')}
Copy link
Member

@rushatgabhane rushatgabhane May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, we should have used zipFormatter here to have consistent hint messages.

Using it would have prevented #16912

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rushatgabhane 😆 It would not have been possible to use that here, it was added only a couple of months ago.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh hahaha, my bad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants