-
Notifications
You must be signed in to change notification settings - Fork 376
feat(LoginForm): Added the PF4 LoginForm Component #874
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
Conversation
|
PatternFly-React preview: https://874-pr-patternfly-react-patternfly.surge.sh |
Pull Request Test Coverage Report for Build 3181
💛 - Coveralls |
christiemolloy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great Titani! CSS/UX Review:
- The login button in the core example has utilities and modifiers on it to make its width responsive on different sizes if you inspect you will see this added to the end of the button classes: "pf-u-mr-lg-on-md pf-u-px-xl pf-u-align-self-stretch pf-u-align-self-flex-start-on-md" . I believe this should be added to the react example to align with what is in core.
- When the fields are empty I don't see the requirement pop up of: "Please fill out this field". Are you thinking of adding that in?
- Super small - can you uncapitalize the "m" in me.
Great job!!
|
@christiemolloy Thanks for the review! |
|
@andybraren which design did you follow for the form in the login box with the requirement pop over?Re point 2 above. |
|
@christiemolloy You mean the design doc from the original Login issue? patternfly/patternfly#43 |
|
@andybraren yes, could you point me to the design for the required warning pop-over "Please fill out this field", that occurs when the user clicks the log-in button and the fields are empty. |
|
@christiemolloy Ah, I see. That popup is Chrome's default behavior for any Changing Good eye Christie! |
|
Great thanks for solving that @andybraren ! |
|
@tlabaj thanks for making those changes this looks great. Tiny thing i didnt catch before - could you change "Log In" to "Log in" per our new capitalization rules. Thanks! CSS/UX approved! |
ibolton336
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
dlabaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the Simple Login demo in the link you provide with this PR.
amarie401
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps rename this to LoginForm, the demo/example isn't showing. This component will probably also need to be exported in the index.js an index.d.ts files of the components directory.
| import flexStyles from '@patternfly/patternfly-next/utilities/Flex/flex.css'; | ||
| import displayStyles from '@patternfly/patternfly-next/utilities/Display/display.css'; | ||
| import alignmentStyles from '@patternfly/patternfly-next/utilities/Alignment/alignment.css'; | ||
| import spacingStyles from '@patternfly/patternfly-next/utilities/Spacing/spacing.css'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there is a similar concern here that this will increase the size of the component too much. Could do something similar as here:
https://github.com/patternfly/patternfly-react/pull/863/files#diff-4e9f1155160426190b5a2ee57a9c0a5fR32
Or use styled-component when the PR is merged :)
| /** Function that handles the onChange event for the Remember Me Checkbox */ | ||
| onChangeRememberMe: PropTypes.func, | ||
| /** Aria Label for the Remember me checkbox */ | ||
| rememberMeAriaLabel: PropTypes.string.isRequired |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should only be required if the rememberMeLabel is also passed in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Checkbox component requires the Aria Label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but in this form having a checkbox with no label would not make sense, so I think if you require the aria-label you should also require the rememberMeLabel. But i could see consumers maybe not wanting to have this checkbox, so perhaps add the logic here, if rememberMeAriaLabel is passed in, then require the aria-label as well. And render the Checkbox conditionally if rememberMeLabel is used.
| usernameValue={this.state.usernameValue} | ||
| onChangeUsername={this.handleUsernameChange} | ||
| usernameHelperTextInvalid="Unknown Username" | ||
| isValidUsername |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tie this to a state variable, and maybe in the handleUsernameChange check if username is less than 3 chars mark it as invalid? And something similar for password. So we can play with invalid state in the example. And the helperText would say something like "Username must be at least 3 characters"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you open an enhancement issue to add this so we can get the form merged. the invalid state is really a function of the form.
What:
Added the PF4 LoginForm Component
#825
Additional issues: