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

Payment DUE[$500] Profile - Inconsistent validation error message for required field in home address #27263

Closed
1 of 6 tasks
izarutskaya opened this issue Sep 12, 2023 · 130 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Sep 12, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to personal details
  2. Click in home address
  3. Address line 1 is required field, when user goes from line 1 to address line2 without entering anything , error is shown
  4. Click on country, a drop down is shown
  5. Don’t select any country and come back
  6. Enter state and city and zip code and click save
  7. Only on clicking save , it shows country is required field

Expected Result:

When country is not selected from drop down it should show validation error

Actual Result:

Not showing until save is clicked

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.68-12

Reproducible in staging?: Y

Reproducible in production?: Y

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

Notes/Photos/Videos: Any additional supporting documentation

RPReplay_Final1694135684.MP4
Screen_Recording_20230912_183232_Chrome.mp4

Expensify/Expensify Issue URL:

Issue reported by: @Premsjce

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694136012916349

View all open jobs on GitHub
Inconsistent validation error message for required field in home address

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012751697148f06172
  • Upwork Job ID: 1701622320141500416
  • Last Price Increase: 2023-10-03
  • Automatic offers:
    • situchan | Reviewer | 0
    • DylanDylann | Contributor | 0
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 12, 2023
@melvin-bot melvin-bot bot changed the title Profile - Inconsistent validation error message for required field in home address [$500] Profile - Inconsistent validation error message for required field in home address Sep 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

Job added to Upwork: https://www.upwork.com/jobs/~012751697148f06172

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

Triggered auto assignment to @tjferriss (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@saraelsa
Copy link

saraelsa commented Sep 12, 2023

Proposal

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

There is an inconsistency in behavior between two required fields:

  • If the user blurs address line 1, a validation message is immediately displayed.
  • If the user closes the country selection menu, a validation message is not immediately displayed, and is only displayed once the form is submitted.

What is the root cause of that problem?

The Form component attaches certain event listeners to form elements, including onInputChange and onBlur. Depending on the configuration, validation is run for a field when the onBlur event fires.

The CountryPicker component exposes an onInputChange prop that is used by the Form component which is how it is able to pick up its value. However, it does not expose a similar onBlur prop that the Form component might use.

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

Create a new property, onBlur, in CountryPicker. The hidePickerModal method will fire onBlur.

What alternative solutions did you explore? (Optional)

In addition to adding the onBlur property, update the Form component to not issue validation errors for empty fields on input. They will be validated on submission.

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@Yrds
Copy link

Yrds commented Sep 12, 2023

Proposal

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

There are two inconsistencies related to validation triggers on Home address Form:

  • Address line 1 text input required field error is shown as soon the user blur on field.
  • Country picker is not being validated as the user closes picker, and only shows validation when user click on submit button.

What is the root cause of that problem?

Address Line 1

  • The Address Line 1 validations is showing up on input blur because the AddressSearch component triggers props.onBlur which is calling validate function on Form component(validate method is called on every onBlur event).

Country picker

  • CountryPicker component doesn't have any trigger when user closes it(when hidePickerModal is called), so there's nothing to perform a validation this moment.

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

  • As Form component is used in multiple pages, the AddressSearch component need to be modified to conditionally NOT call onBlur.
  • CountryPicker needs to trigger onInputChange in order to call proper validation method when user closes modal.

What alternative solutions did you explore? (Optional)

No alternative solutions was explored.

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

📣 @Yrds! 📣
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. 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.
  2. 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.
  3. 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>

@Yrds
Copy link

Yrds commented Sep 12, 2023

Contributor details
Your Expensify account email: yrds96@protonmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01fe692a84ada2b658

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@redpanda-bit
Copy link
Contributor

I think calling the onBlur prop within CountryPicker#hidePickerModal is the right approach.

@Yrds

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

  • As Form component is used in multiple pages, the AddressSearch component need to be modified to conditionally NOT call onBlur.

We want to show the error on input blur so probably would want to keep it as it is now.

  • CountryPicker needs to trigger onInputChange in order to call proper validation method when user closes modal.

I tried this solution while doing my analysis but using onBlur already calls the proper validation method.

@Yrds
Copy link

Yrds commented Sep 12, 2023

Yes, I think you are right. Also, calling onBlur seems to be the default behavior of other Form components on the application.

@redpanda-bit

@melvin-bot melvin-bot bot added the Overdue label Sep 15, 2023
@zanyrenney
Copy link
Contributor

@situchan what are your thoughts on the above please?

@melvin-bot melvin-bot bot removed the Overdue label Sep 15, 2023
@tjferriss tjferriss removed their assignment Sep 18, 2023
@tjferriss
Copy link
Contributor

@zanyrenney it looks like MelvinBot assigned us both. I'm going to unassign myself.

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Sep 20, 2023
@zanyrenney
Copy link
Contributor

weird, okay no worries @tjferriss

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 21, 2023
@melvin-bot melvin-bot bot removed the Overdue label Jan 12, 2024
@situchan
Copy link
Contributor

Ah forgot that hold was lifted. reviewing latest proposals

@melvin-bot melvin-bot bot added the Overdue label Jan 22, 2024
@thienlnam
Copy link
Contributor

@situchan Bump again here

@melvin-bot melvin-bot bot removed the Overdue label Jan 22, 2024
@situchan
Copy link
Contributor

@DylanDylann can you please share test branch?

@DylanDylann
Copy link
Contributor

@situchan Here is the test branch #35326

@DylanDylann
Copy link
Contributor

@situchan Do you have any feedback about this one?

@melvin-bot melvin-bot bot added the Overdue label Feb 7, 2024
@zanyrenney
Copy link
Contributor

bump @situchan

@melvin-bot melvin-bot bot removed the Overdue label Feb 8, 2024
@situchan
Copy link
Contributor

situchan commented Feb 8, 2024

Ah this was missing in my list. Maybe because of weekly

@DylanDylann
Copy link
Contributor

@situchan Any update here?

@situchan
Copy link
Contributor

Thanks for the bump. I will update in an hr

@situchan
Copy link
Contributor

@DylanDylann's proposal looks good to me

@DylanDylann
Copy link
Contributor

@thienlnam Please help to review when you have a chance. Thanks

Copy link

melvin-bot bot commented Feb 16, 2024

📣 @situchan 🎉 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

Copy link

melvin-bot bot commented Feb 16, 2024

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@DylanDylann
Copy link
Contributor

Will open PR today

@DylanDylann
Copy link
Contributor

@situchan PR #35326 is ready to review

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Feb 19, 2024
@situchan
Copy link
Contributor

situchan commented Mar 6, 2024

PR was deployed to production on Feb 28

@DylanDylann
Copy link
Contributor

@zanyrenney Please help to process the next step

@zanyrenney zanyrenney changed the title [$500] Profile - Inconsistent validation error message for required field in home address Payment DUE[$500] Profile - Inconsistent validation error message for required field in home address Mar 18, 2024
@zanyrenney
Copy link
Contributor

payment summary

paid $500 @situchan
paid $500 @DylanDylann

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. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests