-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat(form): added field groups #3654
Conversation
Preview: https://patternfly-pr-3654.surge.sh A11y report: https://patternfly-pr-3654-coverage.surge.sh
|
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.
Expandable groups look good @mcoker . For the non-expandable field groups I would still expect you to be able to create some hierarchy by indenting child groups even when you remove the expansion. Was that also your intent @lboehling ?
@@ -0,0 +1,6 @@ | |||
<div class="pf-c-form__field-group-header-actions{{#if form-field-group-header-actions--modifier}} {{form-field-group-header-actions--modifier}}{{/if}}" |
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.
could you use the new action group here ?
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.
You could, think we could leave it open to add an action group, just a list of actions (like I have here), an overflow menu, etc.
} | ||
} | ||
|
||
.pf-c-form__field-group-toggle { |
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.
why is the toggle split up from the header ? I would have expected them in the same group so that any styles apply to the whole group
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.
It's so that the toggle can have it's own layout in the grid so that we can have
toggle | header stuff
empty | field group contents
Nope, these are non-repeatable field groups. The ones with a border defined between them are repeatable ( |
@christiemolloy are you referring to the descriptions or actions, or both? I would expect the description to wrap like that. Maybe not the actions though... maybe that gets |
### Non-expandable field groups | ||
```hbs | ||
{{#> form form--id="form-non-expandable-field-groups"}} | ||
{{#> form-group form-group--id="-label1"}} |
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.
{{#> form-group form-group--id="-label1"}} | |
{{#> form-group form-group--id="-form-group1-label1"}} |
{{#> form-control controlType="input" input="true" form-control--attribute=(concat 'type="text" id="' form--id form-group--id '" name="' form--id form-group--id '" required')}}{{/form-control}} | ||
{{/form-group-control}} | ||
{{/form-group}} | ||
{{#> form-group form-group--id="-label2"}} |
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.
{{#> form-group form-group--id="-label2"}} | |
{{#> form-group form-group--id="-form-group1-label2"}} |
{{/form-group}} | ||
{{/form-field-group-body}} | ||
{{/form-field-group}} | ||
{{#> form-group form-group--id="-label1"}} |
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.
{{#> form-group form-group--id="-label1"}} | |
{{#> form-group form-group--id="-form-group2-label1"}} |
{{#> form-control controlType="input" input="true" form-control--attribute=(concat 'type="text" id="' form--id form-group--id '" name="' form--id form-group--id '" required')}}{{/form-control}} | ||
{{/form-group-control}} | ||
{{/form-group}} | ||
{{#> form-group form-group--id="-label2"}} |
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.
{{#> form-group form-group--id="-label2"}} | |
{{#> form-group form-group--id="-form-group3-label2"}} |
### Expandable field groups | ||
```hbs | ||
{{#> form form--id="form-expandable-field-groups"}} | ||
{{#> form-group form-group--id="-label1"}} |
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.
{{#> form-group form-group--id="-label1"}} | |
{{#> form-group form-group--id="-form-group1-label1"}} |
{{#> form-control controlType="input" input="true" form-control--attribute=(concat 'type="text" id="' form--id form-group--id '" name="' form--id form-group--id '" required')}}{{/form-control}} | ||
{{/form-group-control}} | ||
{{/form-group}} | ||
{{#> form-group form-group--id="-label2"}} |
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.
{{#> form-group form-group--id="-label2"}} | |
{{#> form-group form-group--id="-form-group2-label2"}} |
{{/form-field-group-header-actions}} | ||
{{/form-field-group-header}} | ||
{{/form-field-group}} | ||
{{#> form-group form-group--id="-label1"}} |
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.
{{#> form-group form-group--id="-label1"}} | |
{{#> form-group form-group--id="-form-group3-label1"}} |
{{#> form-control controlType="input" input="true" form-control--attribute=(concat 'type="text" id="' form--id form-group--id '" name="' form--id form-group--id '" required')}}{{/form-control}} | ||
{{/form-group-control}} | ||
{{/form-group}} | ||
{{#> form-group form-group--id="-label2"}} |
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.
{{#> form-group form-group--id="-label2"}} | |
{{#> form-group form-group--id="-form-group4-label2"}} |
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 agree with @mcarrano now that I'm looking at this again. Probably would want some indentation/cleaned up padding to make sure the non-expanded groups still have some hierarchy. I'm also wondering now if my initial logic for the divider lines is holding up when there is a combo of expandable/non-expandable groups and repeating/non-repeating groups. It might be helpful if we divide these examples into more distinct sections, and then possibly have a demo or two showing them all together? on a smaller note... changing the button text from "Add parameter" to "Add group" might make the repeating field set example more clear. |
@lboehling sounds good, thanks for the review!
Yeah, apologies for the example in this PR - that was really just to put all of the functionality out there for review and see how it all looks together. Before releasing, we'll clean up the examples so they're more consumable. |
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.
LGTM once you update the actions wrapping
@christiemolloy @mattnolting @mcarrano @lboehling @mceledonia updated with Lucia's latest design. Main points are:
|
@lboehling updated the spacing so that if a non-expandable nested group contains a non-expandable group, that whole group (the title and group contents) is indented. Here's a screenshot of a really complex example to show what it would look like |
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 @mcoker! Thank you!!
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.
Beautiful 🤩 !!!
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 great. Nailed it!
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 spectacular!!!! thanks for making all those changes
🎉 This PR is included in version 4.69.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
fixes #3557