FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(DataToolbar): Add Data Toolbar component to experimental by nicolethoen · Pull Request #2861 · patternfly/patternfly-react · GitHub

feat(DataToolbar): Add Data Toolbar component to experimental - #2861

Merged
dlabaj merged 22 commits into
patternfly:masterfrom
nicolethoen:toolbar_component
Sep 10, 2019
Merged

feat(DataToolbar): Add Data Toolbar component to experimental#2861
dlabaj merged 22 commits into
patternfly:masterfrom
nicolethoen:toolbar_component

Conversation

nicolethoen commented Sep 6, 2019
edited
Loading

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Collaborator

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

karelhala left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you so much for this PR! It's a great start, we just have to remove the isExpanded from state and some variable renames and we are good to go!

}

componentDidMount() {
window.addEventListener('resize', this.closeExpandableContent);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please do not listen on resize events and close expandable content. This is css breakpoints work, no need to close the content on each window resize. It adds performance issues and plus unwanted behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@karelhala There's an issue where if the toggle drawer is open and the window is resized when the breakpoint is hit the content will not layout correctly. We're looking for a solution to make it behave the same way that dropdown does. Will look at that code to see how that one works to see if there's a better solution.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is really unaesthetic because imagine that you are looking at table with this on mobile, click on the expand button, realise that landscape view might be better for this and once you flip the phone this expanded menu is lost and user has to click on it once again.

If the layout is not rendered correctly on window resize I think that is more of a issue in PF core and we shouldn't try to fix it here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@mcarrano Any thoughts on the behavior with the toggle?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is a tough one to answer because it's not clear what the best approach is. I agree that just collapsing the drawer on resize it not great. Maybe if the drawer is open and a breakpoint is crossed, the content should not reconfigure itself (i.e. suppress the behavior in this case). Is that even possible? @mattnolting any thoughts here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@mcarrano - matt nolting is on PTO until Tuesday.

regarding that being possible, yes I believe it is, but we'd have to use the breakpoint passed in by the user and look up the global size of that breakpoint and make it reconfigure itself based on the global size (hopefully no one will have over written it). I may not have time to figure that out today - but I can try. Would that be an acceptable approach @dlabaj?

mattnolting Sep 10, 2019
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@mcarrano I think, when using a toggle group, the content should reconfigure at the specified breakpoint if expanded content is .pf-m-expanded.

mattnolting left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Well done @nicolethoen!!! It's really exciting to see all the great work you've done in action. Left some comments.

mturley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Awesome work @nicolethoen !

{toggleIcon}
</Button>
</div>
{ isExpanded ? ReactDOM.createPortal(children, expandableContentRef.current): children }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm so glad this worked! For a while there I thought there might not be a declarative way to achieve this... but context, refs and portals = magic ✨

nicolethoen changed the title [WIP] feat(DataToolbar): Add Data Toolbar component to experimental feat(DataToolbar): Add Data Toolbar component to experimental Sep 9, 2019
mturley previously approved these changes Sep 10, 2019

mturley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Noticed a few non-blocking things, but this looks good to me.

</Select>
</DataToolbarItem>
<DataToolbarItem>
<Select

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There's some inconsistent indentation/spacing here and elsewhere in this file, but I don't think we need to hold up the PR for it. I'll address cases like this when I rebase #2810 after the release, but I'm not sure if Prettier will run on the JSX in our Markdown files, so that's something else I want to look into.

variant="plain"
onClick={toggleIsExpanded}
{...isExpanded && { 'aria-expanded': true }}
// TODO aria-haspopup when isExpanded = true && viewport is smaller than lg global breakpoint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this something we need to implement with this PR, and if not can we open an issue to track it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

good thought

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Let's open an issue for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Issue created

mattnolting left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@nicolethoen Again, great work! Can we add an example of .pf-m-space-items on a group to the Data toolbar spacers example? Perhaps the last two action buttons?

@nicolethoen can we add a horizontal divider to the Data toolbar group stacked example?

@mcarrano @mceledonia should we add a horizontal divider to the Data toolbar group stacked example?

Copy link
Copy Markdown
Contributor Author

@nicolethoen Again, great work! Can we add an example of .pf-m-space-items on a group to the Data toolbar spacers example? Perhaps the last two action buttons?

@nicolethoen can we add a horizontal divider to the Data toolbar group stacked example?

Yes and Yes!

Copy link
Copy Markdown
Member

@nicolethoen This is looking great. Agree with adding the horizontal divider to the stacked example. The only other thing I found is that for the Consumer managed toggle group example, I can get into a situation where the drawer remains open but the toggle disappears by opening the drawer and then stretching the window. See below.

If this is not easy to fix. I'd be OK to approve this and come back to address this as a bug in the next release.

Copy link
Copy Markdown
Contributor

@mcarrano that's exactly what is discussed in #2861 (comment)

Consumers should be rensponsible when the pane is hidden and shown in this example. So if you open this toggle change the screen size and want to close the pane consumer is responsible for that. It's actually expected bahavior.

Copy link
Copy Markdown
Contributor Author

@nicolethoen This is looking great. Agree with adding the horizontal divider to the stacked example. The only other thing I found is that for the Consumer managed toggle group example, I can get into a situation where the drawer remains open but the toggle disappears by opening the drawer and then stretching the window. See below.

If this is not easy to fix. I'd be OK to approve this and come back to address this as a bug in the next release.

I noted this issue in the documentation above the example.

dlabaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

A few comments but looks good otherwise.

className?: string;
/** Content to be rendered as rows in the Data toolbar */
children?: React.ReactNode;
/** Flag indicating if a Data toolbar toggle group's expandable content is expanded */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We should add a comment that setting this means that the consumer will be responsible for managing the toogle group expansion. Also how would a consumer find out if the toogle group is currently expanded after construction??? Can we use a getter to return the correct value.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If the consumer is managing the expansion, they would already know, right? If the consumer is not managing the expansion, why do they need to be able to find out if it's currently expanded?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There is some documentation just before the toggle group examples that i believe explains this? should I add more info to that documentation?

variant="plain"
onClick={toggleIsExpanded}
{...isExpanded && { 'aria-expanded': true }}
// TODO aria-haspopup when isExpanded = true && viewport is smaller than lg global breakpoint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Let's open an issue for this.

dlabaj previously approved these changes Sep 10, 2019
mcarrano previously approved these changes Sep 10, 2019

mcarrano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks great @nicolethoen !

mattnolting left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just two more comments 😄

<DataToolbarItem spacers={fifthSpacers}><Button variant="secondary">Action</Button></DataToolbarItem>
<DataToolbarItem><Button variant="primary">Action</Button></DataToolbarItem>
<DataToolbarItem variant="separator"></DataToolbarItem>
<DataToolbarGroup itemSpacers={[{spacerSize: 'lg'}]} spacers={[{spacerSize: 'lg'}]}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can you remove spacers={[{spacerSize: 'lg'}]}

<DataToolbarItem variant="separator"></DataToolbarItem>
<DataToolbarGroup itemSpacers={[{spacerSize: 'lg'}]} spacers={[{spacerSize: 'lg'}]}>
<DataToolbarItem><Button variant="secondary">Action</Button></DataToolbarItem>
` <DataToolbarItem><Button variant="secondary">Action</Button></DataToolbarItem>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

looks like you have a floating tick mark ^^

nicolethoen dismissed stale reviews from mcarrano and dlabaj via abe78d6 September 10, 2019 18:54

mattnolting left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I love it!! 🎉 LGTM

tlabaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

mturley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM!

dlabaj merged commit 6ec0ce4 into patternfly:master Sep 10, 2019

Copy link
Copy Markdown
Collaborator

Your changes have been released in:

  • @patternfly/react-core@3.104.0
  • @patternfly/react-docs@4.13.0
  • @patternfly/react-inline-edit-extension@2.11.35
  • demo-app-ts@2.24.8
  • @patternfly/react-table@2.20.15
  • @patternfly/react-topology@2.8.34
  • @patternfly/react-virtualized-extension@1.2.23

Thanks for your contribution! 🎉

nicolethoen deleted the toolbar_component branch February 8, 2023 13:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

8 participants


Back | FazBrowse Home | New Git URL