Skip to content

Conversation

@tlabaj
Copy link
Contributor

@tlabaj tlabaj commented Nov 2, 2018

What:
Added the PF4 LoginForm Component
#825

Additional issues:

@patternfly-build
Copy link
Collaborator

PatternFly-React preview: https://874-pr-patternfly-react-patternfly.surge.sh

@coveralls
Copy link

coveralls commented Nov 2, 2018

Pull Request Test Coverage Report for Build 3181

  • 12 of 13 (92.31%) changed or added relevant lines in 1 file are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 81.298%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/patternfly-4/react-core/src/components/LoginPage/LoginForm.js 12 13 92.31%
Files with Coverage Reduction New Missed Lines %
packages/patternfly-3/patternfly-react-extensions/src/components/CatalogTileView/CatalogTileViewCategory.js 4 84.06%
Totals Coverage Status
Change from base Build 3154: 0.2%
Covered Lines: 3780
Relevant Lines: 4382

💛 - Coveralls

Copy link
Member

@christiemolloy christiemolloy left a 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:

  1. 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.
  2. 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?
  3. Super small - can you uncapitalize the "m" in me.

Great job!!

@tlabaj
Copy link
Contributor Author

tlabaj commented Nov 5, 2018

@christiemolloy Thanks for the review!
I will update the example for point 1 and 3.
Can you please let me know more about item 2 and where I can find the design for this.

@christiemolloy
Copy link
Member

christiemolloy commented Nov 5, 2018

@andybraren which design did you follow for the form in the login box with the requirement pop over?Re point 2 above.

@andybraren
Copy link
Contributor

@christiemolloy You mean the design doc from the original Login issue? patternfly/patternfly#43

@christiemolloy
Copy link
Member

@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.

@andybraren
Copy link
Contributor

@christiemolloy Ah, I see. That popup is Chrome's default behavior for any input with a required attribute that is empty when the form's submit button is clicked.

Changing type="button" of this demo's button to type="submit" restores the browser's behavior. I'll create a new issue to add 'type="submit" to the button in Core's Login demo as well.

Good eye Christie!

@christiemolloy
Copy link
Member

Great thanks for solving that @andybraren !

@christiemolloy
Copy link
Member

@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
ibolton336 previously approved these changes Nov 7, 2018
Copy link
Member

@ibolton336 ibolton336 left a 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!

Copy link
Contributor

@dlabaj dlabaj left a 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.

Copy link
Contributor

@amarie401 amarie401 left a 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';
Copy link
Collaborator

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
Copy link
Collaborator

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

Copy link
Contributor Author

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

Copy link
Collaborator

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.

dlabaj
dlabaj previously approved these changes Nov 9, 2018
usernameValue={this.state.usernameValue}
onChangeUsername={this.handleUsernameChange}
usernameHelperTextInvalid="Unknown Username"
isValidUsername
Copy link
Collaborator

@jschuler jschuler Nov 12, 2018

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"

Copy link
Contributor Author

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.

dlabaj
dlabaj previously approved these changes Nov 13, 2018
@dlabaj dlabaj merged commit befeb77 into patternfly:master Nov 13, 2018
@LHinson LHinson mentioned this pull request Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants