mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
allow to add annotation for non editable dashboard
This commit is contained in:
parent
0841e67da8
commit
fe301142ba
@ -674,7 +674,7 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ranges.ctrlKey || ranges.metaKey) && dashboard.meta.canEdit) {
|
if ((ranges.ctrlKey || ranges.metaKey) && contextSrv.isEditor) {
|
||||||
// Add annotation
|
// Add annotation
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
eventManager.updateTime(ranges.xaxis);
|
eventManager.updateTime(ranges.xaxis);
|
||||||
@ -695,7 +695,7 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pos.ctrlKey || pos.metaKey) && dashboard.meta.canEdit) {
|
if ((pos.ctrlKey || pos.metaKey) && contextSrv.isEditor) {
|
||||||
// Skip if range selected (added in "plotselected" event handler)
|
// Skip if range selected (added in "plotselected" event handler)
|
||||||
let isRangeSelection = pos.x !== pos.x1;
|
let isRangeSelection = pos.x !== pos.x1;
|
||||||
if (!isRangeSelection) {
|
if (!isRangeSelection) {
|
||||||
|
Loading…
Reference in New Issue
Block a user