mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboards: Show copy menu item to editors (regardless of dashboard edit state) (#64826)
This commit is contained in:
parent
24ecc7d0dc
commit
a0d440fb03
@ -187,8 +187,8 @@ export function getPanelMenu(
|
||||
|
||||
const subMenu: PanelMenuItem[] = [];
|
||||
const canEdit = dashboard.canEditPanel(panel);
|
||||
|
||||
if (canEdit && !(panel.isViewing || panel.isEditing)) {
|
||||
if (!(panel.isViewing || panel.isEditing)) {
|
||||
if (canEdit) {
|
||||
subMenu.push({
|
||||
text: t('panel.header-menu.duplicate', `Duplicate`),
|
||||
onClick: onDuplicatePanel,
|
||||
@ -211,6 +211,13 @@ export function getPanelMenu(
|
||||
onClick: onAddLibraryPanel,
|
||||
});
|
||||
}
|
||||
} else if (contextSrv.isEditor) {
|
||||
// An editor but the dashboard is not editable
|
||||
subMenu.push({
|
||||
text: t('panel.header-menu.copy', `Copy`),
|
||||
onClick: onCopyPanel,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// add old angular panel options
|
||||
|
Loading…
Reference in New Issue
Block a user