-
Notifications
You must be signed in to change notification settings - Fork 667
add submenu support to resource action menus #3922
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
add submenu support to resource action menus #3922
Conversation
450ecba to
69d602c
Compare
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.
should there be a keycode 37 check for closing the submenu i.e setOpen(false)?
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.
Left arrow is being captured in the scope of the sub menu itself. See code below on line 80 of this file.
|
/retest |
69d602c to
5501631
Compare
|
/kind feature |
|
Verified locally |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, karthikjeeyar The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
8 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
Fixes https://issues.redhat.com/browse/ODC-2712
Related to work in topology view to have a way to access the Add actions in-context: #3918
Problem
Kebab actions only support a flat list.
Patternfly does not have any sub menu support either.
Many more actions are being added to resources and a flat list of actions will become much too large.
Solution
This PR builds off the earlier support for popper.js based menus. These menus automatically align to the left or right depending on where space is available. The preference is set to always open to the right if there is available space. This is why in the screenshots for the kebab and actions dropdown, the 2nd nested menu appears out to the right. The nesting of sub menus multiple levels deep is shown in the screenshots because the solution has no restriction on depth.
There is some duplicate code between kebab and topology in the popper setup but they are are based on two very different menu implementations. Also, we are trying to keep topology pure from console dependencies to eventually push it to PF.
The way to specify actions to appear in a sub menu is by using the new
pathprop of theKebabOption. The path is a/separated string where each segment denotes a new sub menu entry. Eg.Menu 1/Menu 2/Menu 3There is keyboard support as well.
Right-Arrow | Enteropens a sub menuLeft-Arrowcloses a sub menuEsccontinues to close the entire menu for kebab and topology while only closing sub menus in the dropdown. This is because of the way dropdowns have a very different implementation.Keyboard navigation:

cc @spadgett @karthikjeeyar @andrewballantyne