Skip to content

Refactor DatePicker to be compatible with Form #7536

Closed

Description

@luacmartins

With the implementation of our new Form component we need to refactor DatePicker 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. In the input’s onChange method (or equivalent e.g. onTextChange, etc), call props.onChange().
  7. Remove the hasError prop.
  8. Add an optional errorText prop. Defaults to an empty string.
  9. Update the error message to display if errorText is truthy.
  10. 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
  11. 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().
  12. 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.
  13. Remove any unused code.

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

Job Post https://www.upwork.com/jobs/~015dde9db58cb60ea3

Activity

  1. added
    External
    Daily
    on Feb 2, 2022
  2. MelvinBot commented on Feb 2, 2022

    @MelvinBot
    Contributor

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

  3. kevinksullivan commented on Feb 3, 2022

    @kevinksullivan
    Contributor
  4. MelvinBot commented on Feb 3, 2022

    @MelvinBot
    Contributor

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

  5. added
    Help Wanted
    on Feb 3, 2022
  6. MelvinBot commented on Feb 3, 2022

    @MelvinBot
    Contributor

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

  7. 28 remaining items

  8. added
    Internal
    on Apr 22, 2022
  9. added
    Weekly
    and removed
    Help Wanted
    on Apr 22, 2022
  10. self-assigned this
    on Apr 22, 2022
  11. removed
    Reviewing
    on Apr 22, 2022
  12. rushatgabhane commented on Apr 22, 2022

    @rushatgabhane
    Member

    @kevinksullivan no C+ payments due here.

  13. removed their assignment
    on Apr 26, 2022
  14. added
    Reviewing
    on Apr 26, 2022
  15. luacmartins commented on Apr 26, 2022

    @luacmartins
    ContributorAuthor

    @kevinksullivan this was made Internal, please delete the Upwork job when you get a chance. Removing the Exported label.

  16. kevinksullivan commented on Apr 26, 2022

    @kevinksullivan
    Contributor

    All set, post is not longer accepting proposals and I cancelled out the contract.

  17. changed the title [-][$250] Refactor DatePicker to be compatible with Form[/-] [+]Refactor DatePicker to be compatible with Form[/+] on Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

EngineeringInternalReviewingTaskWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions