Commit d654255d by Dominik Prokop Committed by GitHub

NewPanelEditor: adjust panel menu items (#23888)

parent ff4d199c
......@@ -84,14 +84,16 @@ export function getPanelMenu(
const menu: PanelMenuItem[] = [];
menu.push({
text: 'View',
iconClassName: 'eye',
onClick: onViewPanel,
shortcut: 'v',
});
if (!panel.isEditing) {
menu.push({
text: 'View',
iconClassName: 'eye',
onClick: onViewPanel,
shortcut: 'v',
});
}
if (dashboard.canEditPanel(panel)) {
if (dashboard.canEditPanel(panel) && !panel.isEditing) {
menu.push({
text: 'Edit',
iconClassName: 'edit',
......@@ -185,15 +187,17 @@ export function getPanelMenu(
}
}
menu.push({
type: 'submenu',
text: 'More...',
iconClassName: 'cube',
subMenu: subMenu,
onClick: onMore,
});
if (!panel.isEditing) {
menu.push({
type: 'submenu',
text: 'More...',
iconClassName: 'cube',
subMenu: subMenu,
onClick: onMore,
});
}
if (dashboard.canEditPanel(panel)) {
if (dashboard.canEditPanel(panel) && !panel.isEditing) {
menu.push({ type: 'divider' });
menu.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment