Skip to content

[HOLD for payment 2022-03-22] Refactor CheckboxWithLabel to be compatible with Form #7531

Closed

Description

@luacmartins

With the implementation of our new Form component we need to refactor CheckboxWithLabel 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.

Activity

  1. MelvinBot commented on Feb 2, 2022

    @MelvinBot
    Contributor

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

  2. thesahindia commented on Feb 2, 2022

    @thesahindia
    Member

    Proposal

    I think the requirements are quite clear and I would like to work on it.
    (Also worked on PhoneTextInput component #7328)

  3. MelvinBot commented on Feb 3, 2022

    @MelvinBot
    Contributor

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

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

    @MelvinBot
    Contributor

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

  6. 29 remaining items

  7. mallenexpensify commented on Feb 23, 2022

    @mallenexpensify
    Contributor

    PR is being worked on

  8. mallenexpensify commented on Mar 3, 2022

    @mallenexpensify
    Contributor

    PR is being reviewed 🚂

  9. mallenexpensify commented on Mar 9, 2022

    @mallenexpensify
    Contributor

    Waiting on one.. last.. change before PR is merged

  10. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Mar 15, 2022
  11. botify commented on Mar 15, 2022

    @botify

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.1.42-6 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-03-22. 🎊

  12. changed the title [-]Refactor CheckboxWithLabel to be compatible with Form[/-] [+][HOLD for payment 2022-03-22] Refactor CheckboxWithLabel to be compatible with Form[/+] on Mar 15, 2022
  13. MelvinBot commented on Mar 25, 2022

    @MelvinBot
    Contributor

    @tgolen, @mallenexpensify, @rushatgabhane, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!

  14. mallenexpensify commented on Mar 25, 2022

    @mallenexpensify
    Contributor

    Paid @rushatgabhane and @thesahindia $250 each for the fix and C+ Sorry for the delay

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 contributorTask

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions