-
Notifications
You must be signed in to change notification settings - Fork 993
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
Fixes #37675 - Change All Hosts kebab menu to match design #10252
Fixes #37675 - Change All Hosts kebab menu to match design #10252
Conversation
22e32b9
to
e045366
Compare
.pf-c-menu.pf-m-flyout { | ||
position: absolute; | ||
top: 3.1em; | ||
} |
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.
Please use more specific rule, for the host index, and add a space at the end
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.
actually might be better to "just" use a popper to do it properly https://v4-archive.patternfly.org/v4/demos/composable-menu/
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.
@jeremylenz what do you think of the popper?
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.
Just saw your comment. I have never in my life seen that part of the PF documentation. 🙈 I hate the idea of using a ref, but I can change it if you think that's better.
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 trust a popper just a bit more than top: 3.1em;
😅
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.
That was easier than I thought.. updated
e045366
to
cf38a35
Compare
@MariaAga CSS updated 👍 |
cf38a35
to
b593baf
Compare
updated to eliminate custom CSS |
webpack/assets/javascripts/react_app/components/HostsIndex/ActionKebab.js
Outdated
Show resolved
Hide resolved
b593baf
to
c6a6832
Compare
Refs #37675 - Add registry for table row kebab actions use Popper for menu toggle
c6a6832
to
d3b83e8
Compare
I see , in console:
|
Yeah, see the description - I don't know that it will be possible to have a flyout menu without that. Hopefully I missed something else in the documentation and you're about to tell me :) |
Oh nevermind, I meant to mention that in the description and then I didn't |
result[pluginName] = coreTableRowActionsRegistry[pluginName][tableName]; | ||
} | ||
}); | ||
// { katello: { getActions: [Function: getActions] } } |
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.
leftovers
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 one is on purpose, so you know what the object looks like :)
The console error can be fixed in the Katello pr and not 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.
Looks good! Thanks @jeremylenz, can be merged after the code comment removal
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.
Thank you @jeremylenz!
This PR updates the kebab menus in the All Hosts page to match existing designs.
The design calls for a fly-out menu like this:
The problem is that the Patternfly
<Dropdown>
component does not support this fly-out menu style. Per the Patternfly documentation, it seems the only way to accomplish this was with a<Menu>
component, and switch all theDropdownItem
s toMenuItem
s.Menu
does not handle its own open/closed state, so I had to introduce a new state and handlers for this. I use it both directly here in Foreman, and also in theForemanActionsBarContext
so that Katello can close its own submenu when the user clicks on something.Menu
also doesn't handle its own positioning and apparently offers no easy way to pair with itsMenuToggle
, soI was forced to do some manual CSS there as well.