Skip to content
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

fix(Form): Do not add any class if action modifier is missing #792

Merged
merged 1 commit into from
Oct 17, 2018

Conversation

karelhala
Copy link
Contributor

Fixes currently broken master, because there is no info modifier for FormGroup.

@patternfly-build
Copy link
Contributor

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

amarie401
amarie401 previously approved these changes Oct 16, 2018
@@ -17,7 +17,7 @@ const defaultProps = {
};

const ActionGroup = ({ className, children, ...props }) => {
const customClassName = css(styles.formGroup, getModifier(styles, 'action', styles.modifiers.info), className);
const customClassName = css(styles.formGroup, getModifier(styles, 'action'), className);
Copy link
Contributor

Choose a reason for hiding this comment

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

I missed this in the last review. it would probably be better to just use styles.modifiers.action

Suggested change
const customClassName = css(styles.formGroup, getModifier(styles, 'action'), className);
const customClassName = css(styles.formGroup, styles.modifiers.action, className);

This would allow the babel plugin to throw at build time if this is ever modified. getModifier should only be used if the modifier is coming in via props.

Copy link
Contributor

Choose a reason for hiding this comment

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

@karelhala Thanks for fixing this! 👍 🙏

Optional, Nit/ we can remove classes for styles and write them in-line

<div {...props} className={css(styles.formGroup, styles.modifiers.action, className)}> {isHorizontal ? <div className={css(styles.formHorizontalGroup)}>{children}</div> : children} </div>

@dmiller9911
Copy link
Contributor

@karelhala do you mind modifying this line too:
https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-4/react-core/package.json#L38

it should be yarn build:babel && yarn build:ts the ; currently allows the script to continue on an error which is allowing failed builds to get published.

@coveralls
Copy link

coveralls commented Oct 17, 2018

Pull Request Test Coverage Report for Build 2672

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 81.136%

Totals Coverage Status
Change from base Build 2668: 0.0%
Covered Lines: 3435
Relevant Lines: 3989

💛 - Coveralls

@jschuler
Copy link
Collaborator

#797 addressed some of these issues as well. We can use this PR to make the change to not use getModifier in the cases where modifier is not coming in via prop

@karelhala
Copy link
Contributor Author

@ALL sorry for the late response, I like that you merged #797! I've updated this PR not to use getModifiers function and just straigh modifier from styles.

@tlabaj tlabaj merged commit dee29d4 into patternfly:master Oct 17, 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