Scenes: Fix issue where annotations with same name wouldn't render properly (#85489)

Closes #85457
This commit is contained in:
kay delaney 2024-04-04 10:45:24 +01:00 committed by GitHub
parent 130d561924
commit 9537de26a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,5 @@
import { uniqueId } from 'lodash';
import { DataFrameDTO, DataFrameJSON, TypedVariableModel } from '@grafana/data';
import { config } from '@grafana/runtime';
import {
@ -248,7 +250,7 @@ export function createDashboardSceneFromDashboardModel(oldModel: DashboardModel)
annotationLayers = oldModel.annotations?.list.map((a) => {
// Each annotation query is an individual data layer
return new DashboardAnnotationsDataLayer({
key: `annotations-${a.name}`,
key: uniqueId('annotations-'),
query: a,
name: a.name,
isEnabled: Boolean(a.enable),