mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: Hide edit/delete if annotations are from loki (#96141)
add in logic to hide edit/delete on annotations from loki
This commit is contained in:
parent
ed623f52db
commit
06f2f62223
@ -22,8 +22,10 @@ export const AnnotationTooltip2 = ({ annoVals, annoIdx, timeZone, onEdit }: Prop
|
||||
const { canEditAnnotations = retFalse, canDeleteAnnotations = retFalse, onAnnotationDelete } = usePanelContext();
|
||||
|
||||
const dashboardUID = annoVals.dashboardUID?.[annoIdx];
|
||||
const canEdit = canEditAnnotations(dashboardUID);
|
||||
const canDelete = canDeleteAnnotations(dashboardUID) && onAnnotationDelete != null;
|
||||
|
||||
// grafana can be configured to load alert rules from loki. Those annotations cannot be edited or deleted. The id being 0 is the best indicator the annotation came from loki
|
||||
const canEdit = annoId !== 0 && canEditAnnotations(dashboardUID);
|
||||
const canDelete = annoId !== 0 && canDeleteAnnotations(dashboardUID) && onAnnotationDelete != null;
|
||||
|
||||
const timeFormatter = (value: number) =>
|
||||
dateTimeFormat(value, {
|
||||
|
Loading…
Reference in New Issue
Block a user