mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
NewPanelEditor: adjust panel menu items (#23888)
This commit is contained in:
parent
ff4d199ce4
commit
d654255d32
@ -84,14 +84,16 @@ export function getPanelMenu(
|
|||||||
|
|
||||||
const menu: PanelMenuItem[] = [];
|
const menu: PanelMenuItem[] = [];
|
||||||
|
|
||||||
menu.push({
|
if (!panel.isEditing) {
|
||||||
text: 'View',
|
menu.push({
|
||||||
iconClassName: 'eye',
|
text: 'View',
|
||||||
onClick: onViewPanel,
|
iconClassName: 'eye',
|
||||||
shortcut: 'v',
|
onClick: onViewPanel,
|
||||||
});
|
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,15 +187,17 @@ export function getPanelMenu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.push({
|
if (!panel.isEditing) {
|
||||||
type: 'submenu',
|
menu.push({
|
||||||
text: 'More...',
|
type: 'submenu',
|
||||||
iconClassName: 'cube',
|
text: 'More...',
|
||||||
subMenu: subMenu,
|
iconClassName: 'cube',
|
||||||
onClick: onMore,
|
subMenu: subMenu,
|
||||||
});
|
onClick: onMore,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (dashboard.canEditPanel(panel)) {
|
if (dashboard.canEditPanel(panel) && !panel.isEditing) {
|
||||||
menu.push({ type: 'divider' });
|
menu.push({ type: 'divider' });
|
||||||
|
|
||||||
menu.push({
|
menu.push({
|
||||||
|
Loading…
Reference in New Issue
Block a user