[v11.0.x] Scenes: Fix issue where annotations with same name wouldn't render properly (#85576)

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

Closes #85457

(cherry picked from commit 9537de26a5)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-04-04 15:01:57 +01:00
committed by GitHub
co-authored by kay delaney
parent 46088003a4
commit b7f1fa0ff5
@@ -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),