Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Update forms to use custom Input ui component #281

Merged
merged 5 commits into from Jul 18, 2016
Merged

Conversation

stephanethomas
Copy link
Contributor

@stephanethomas stephanethomas commented Jul 18, 2016

This pull request fixes https://github.com/Automattic/delphin/issues/249 to make the forms on the Login, Signup, and Verify User pages more consistent with the rest of the forms. More specifically, it makes sure the custom <Input> component is used in every appropriate places so validation errors are correctly displayed. This pull request also updates the code to address several React warnings that were generated by the redux-form library.

Testing instructions

You should keep an eye on your browser's console for possible warning and error messages:

  1. Run git checkout update/forms and start your server, or open a live branch
  2. Open the Search page
  3. Proceed until the end of the checkout
  4. Check that no warning or error (except the one mentioned below) is thrown in the console
  5. Check that everything works as before

Additional notes

Note the following warning is still displayed in the console when inline validation is triggered:

warning.js:44 Warning: Unknown prop `xmlns` on <svg> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
  in svg
  in Gridicon (created by Input)

This is something that has been addressed in facebook/react#6471 and that will be available in React 15.3.0.

Reviews

  • Code
  • Product
  • Tests

@Automattic/sdev-feed

valid, visited, asyncValidating, autofocus, ...validProps } = props;
const {
active,
autofill,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of removing asyncValidating from this list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's because it's useless since it's not part of the list of props that redux-form provides inside the fields object.

@drewblaisdell
Copy link
Contributor

Code 👍

@fabianapsimoes
Copy link
Contributor

Product 👍

* @returns {object} props filtered
* https://github.com/erikras/redux-form/issues/1249
*
* This function should be removed once redux-form is upgraded to version 6.
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems v6 won't fix this, it just provides a cleaner syntax to create input components.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh ok it has this input prop with all the valid properties

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants