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

feat(form): added field groups #3654

Merged
merged 6 commits into from
Dec 2, 2020
Merged

Conversation

mcoker
Copy link
Contributor

@mcoker mcoker commented Nov 10, 2020

fixes #3557

@mcoker mcoker requested review from mcarrano and lboehling November 10, 2020 15:19
@patternfly-build
Copy link

patternfly-build commented Nov 10, 2020

Preview: https://patternfly-pr-3654.surge.sh

A11y report: https://patternfly-pr-3654-coverage.surge.sh

CSS Size Report
NameCurrentPreviousDiff %
components/Form/form.css16.6 kB8.4 kB49.28
patternfly-no-reset.css948.8 kB940.6 kB0.86
patternfly.css950.6 kB942.5 kB0.86
patternfly.min.css843.8 kB836.2 kB0.89

Copy link
Member

@mcarrano mcarrano left a 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}}"
Copy link
Member

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 ?

Copy link
Contributor Author

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 {
Copy link
Member

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

Copy link
Contributor Author

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

@christiemolloy
Copy link
Member

is this how you would expect these to overflow or should they truncate ?

Screen Shot 2020-11-11 at 10 17 07 AM

@christiemolloy
Copy link
Member

Should the Field Groups here have a border between them like the other field groups?

Screen Shot 2020-11-11 at 10 24 08 AM

@mcoker
Copy link
Contributor Author

mcoker commented Nov 11, 2020

Should the Field Groups here have a border between them like the other field groups?

Nope, these are non-repeatable field groups. The ones with a border defined between them are repeatable (.pf-m-repeatable)

@mcoker
Copy link
Contributor Author

mcoker commented Nov 11, 2020

is this how you would expect these to overflow or should they truncate ?

@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 white-space: nowrap;?

### Non-expandable field groups
```hbs
{{#> form form--id="form-non-expandable-field-groups"}}
{{#> form-group form-group--id="-label1"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{#> 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"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{#> 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"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{#> 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"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{#> 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"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{#> 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"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{#> 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"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{#> 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"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{#> form-group form-group--id="-label2"}}
{{#> form-group form-group--id="-form-group4-label2"}}

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

I think you could set .pf-c-form__field-group-header-actions to nowrap, then stack the header on smaller viewports and split on larger viewports.

Screen Shot 2020-11-11 at 3 09 31 PM

Screen Shot 2020-11-11 at 3 06 31 PM

Screen Shot 2020-11-11 at 2 00 07 PM

@lboehling
Copy link

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 ?

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.

@mcoker @mcarrano

@mcoker
Copy link
Contributor Author

mcoker commented Nov 11, 2020

@lboehling sounds good, thanks for the review!

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?

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.

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.

LGTM once you update the actions wrapping

@mcoker
Copy link
Contributor Author

mcoker commented Nov 23, 2020

@christiemolloy @mattnolting @mcarrano @lboehling @mceledonia updated with Lucia's latest design.

Main points are:

  • Border under top-level group title/toggle, and between nested groups, spans the full width
  • Always a border between nested groups (no longer based on being repeatable)
  • Top-level non-expandable group contents is indented, but nested non-expandable groups are not

@mcoker
Copy link
Contributor Author

mcoker commented Dec 2, 2020

@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

Screen Shot 2020-12-01 at 7 44 02 PM

Copy link

@lboehling lboehling 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 @mcoker! Thank you!!

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

Beautiful 🤩 !!!

Copy link
Member

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

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 spectacular!!!! thanks for making all those changes

@mcoker mcoker merged commit c48d40a into patternfly:master Dec 2, 2020
@redallen
Copy link
Contributor

redallen commented Dec 2, 2020

🎉 This PR is included in version 4.69.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mcoker mcoker deleted the issue-3557-2 branch January 7, 2025 16:52
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.

Introduce form sections
7 participants