feat: 🎸 add separator for different context menu groups (#80498) (#80806)

This commit is contained in:
Vadim Dalecky 2020-10-16 16:00:53 +02:00 committed by GitHub
parent bb5968c2d0
commit 400403b96f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -39,7 +39,7 @@ export const PanelEditWithDrilldownsAndContextActions: React.FC = () => {
const customActionGrouping: Action['grouping'] = [
{
id: 'actions',
getDisplayName: () => 'Custom actions',
getDisplayName: () => 'API actions',
getIconType: () => 'cloudStormy',
order: 20,
},

View file

@ -201,8 +201,10 @@ export async function buildContextMenuForActions({
for (const panel of Object.values(panels)) {
if (panel._level === 0) {
// TODO: Add separator line here once it is available in EUI.
// See https://github.com/elastic/eui/pull/4018
panels.mainMenu.items.push({
isSeparator: true,
key: panel.id + '__separator',
});
if (panel.items.length > 3) {
panels.mainMenu.items.push({
name: panel.title || panel.id,