Commit d654255d by Dominik Prokop Committed by GitHub

NewPanelEditor: adjust panel menu items (#23888)

parent ff4d199c
...@@ -84,14 +84,16 @@ export function getPanelMenu( ...@@ -84,14 +84,16 @@ export function getPanelMenu(
const menu: PanelMenuItem[] = []; const menu: PanelMenuItem[] = [];
if (!panel.isEditing) {
menu.push({ menu.push({
text: 'View', text: 'View',
iconClassName: 'eye', iconClassName: 'eye',
onClick: onViewPanel, onClick: onViewPanel,
shortcut: 'v', shortcut: 'v',
}); });
}
if (dashboard.canEditPanel(panel)) { if (dashboard.canEditPanel(panel) && !panel.isEditing) {
menu.push({ menu.push({
text: 'Edit', text: 'Edit',
iconClassName: 'edit', iconClassName: 'edit',
...@@ -185,6 +187,7 @@ export function getPanelMenu( ...@@ -185,6 +187,7 @@ export function getPanelMenu(
} }
} }
if (!panel.isEditing) {
menu.push({ menu.push({
type: 'submenu', type: 'submenu',
text: 'More...', text: 'More...',
...@@ -192,8 +195,9 @@ export function getPanelMenu( ...@@ -192,8 +195,9 @@ export function getPanelMenu(
subMenu: subMenu, subMenu: subMenu,
onClick: onMore, onClick: onMore,
}); });
}
if (dashboard.canEditPanel(panel)) { if (dashboard.canEditPanel(panel) && !panel.isEditing) {
menu.push({ type: 'divider' }); menu.push({ type: 'divider' });
menu.push({ 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