-
Notifications
You must be signed in to change notification settings - Fork 19
Conversation
1631d24
to
6536910
Compare
Added option to configure the "kebabization" of the menu items. * kebabLimit === -1 means no compacting * kebabLimit === 0 means always compact into kebab * other values of give number of items to keep, before the rest is kebabized.
6536910
to
8e1ef18
Compare
@martinpovolny can you update the snapshot please? |
@@ -10,12 +10,46 @@ const wrapperComponent = () => ( | |||
<React.Fragment> | |||
<div className="toolbar-pf row"> | |||
<Toolbar | |||
count={1} |
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.
Can I ask what does the count does and why is it required?
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.
In manageiq the toolbar needs count of selected items in the GTL on the page.
Anyway: making it optional, adding default value.
a457d8e
to
eca9656
Compare
Checked commits martinpovolny/react-ui-components@8e1ef18~...a0d656b with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
@@ -91,17 +107,23 @@ export const Toolbar = props => ( | |||
.filter(toolbarGroupHasContent) | |||
.map((group, index) => | |||
/* eslint react/no-array-index-key: "off" */ | |||
<ToolbarGroup key={index} onClick={props.onClick} group={collapseCustomGroups(group)} />) | |||
<ToolbarGroup key={index} onClick={props.onClick} group={collapseCustomGroups(group, props.kebabLimit)} />) |
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 suppose we don't have anything better than index right?
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.
Not for the group. But the index is stable.
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.
🎉 This PR is included in version 0.11.57 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Added option to configure the "kebabization" of the menu items.
TODO
update specsadd specs for the new behaviorTesting
Running the
npm run server
gives you an example of behavior for different values ofkebabLimit
.BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1683703
Further changes:
count
optional the same askebabLimit
(based on PR review feedback)