Skip to content

[HOLD for payment 2022-05-20] [$500] Refactor StatePicker to be compatible with Form #7537

Closed

Description

@luacmartins

With the implementation of our new Form component we need to refactor StatePicker to be Form compatible. Here are the changes that need to be made:

  1. An optional isFormInput prop.
  2. If isFormInput is true, require a inputID prop. Use getInputIDPropTypes to enforce this propType rule.
  3. Add an optional shouldSaveDraft prop. Defaults to false.
  4. Make the value prop optional.
  5. In the input’s onBlur method, call props.onBlur().
  6. Rename the input's onChange method to onInputChange.
  7. In the input’s onInputChange method (or equivalent e.g. onTextChange, etc), call props.onInputChange().
  8. Remove the hasError prop.
  9. Add an optional errorText prop. Defaults to an empty string.
  10. Update the error message to display if errorText is truthy.
  11. Update the inline error display style so it is left aligned with the label and input value. See example image for TextInput:
    Screen Shot 2022-02-02 at 10 37 38 AM
  12. Make sure that props.ref is attached to the appropriate DOM node. This could involve forwarding the ref to a child component. This is important so we can call ref.focus().
  13. Add the input to the test Form stories and make sure that it works. You can check this by running npm run storybook and testing the component in the example form.
  14. Remove any unused code.

There's an example of a refactor to TextInput in this PR.

Activity

  1. MelvinBot commented on Feb 2, 2022

    @MelvinBot
    Contributor

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

  2. MitchExpensify commented on Feb 2, 2022

    @MitchExpensify
  3. MelvinBot commented on Feb 2, 2022

    @MelvinBot
    Contributor

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

  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 2, 2022
  5. MelvinBot commented on Feb 2, 2022

    @MelvinBot
    Contributor

    Triggered auto assignment to @thienlnam (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  6. 77 remaining items

  7. jayeshmangwani commented on Apr 23, 2022

    @jayeshmangwani
    Contributor

    PR raised
    @parasharrajat

  8. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on May 13, 2022
  9. changed the title [-][$500] Refactor StatePicker to be compatible with Form[/-] [+][HOLD for payment 2022-05-20] [$500] Refactor StatePicker to be compatible with Form[/+] on May 13, 2022
  10. melvin-bot commented on May 13, 2022

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.1.57-17 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2022-05-20. 🎊

  11. MitchExpensify commented on May 20, 2022

    @MitchExpensify
    Contributor

    https://www.upwork.com/jobs/~0116994c22a1b60fb6 mind applying here @parasharrajat so I can issue C+ payment?

  12. MitchExpensify commented on May 20, 2022

    @MitchExpensify
    Contributor

    Paid @jayeshmangwani , thank you very much!

  13. jayeshmangwani commented on May 20, 2022

    @jayeshmangwani
    Contributor
  14. parasharrajat commented on May 20, 2022

    @parasharrajat
    Member
  15. MitchExpensify commented on May 23, 2022

    @MitchExpensify
    Contributor

    Done! Thanks all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewTask

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions