chore: add datalink to TestData annotations scenario

This commit is contained in:
Galen 2025-10-07 14:51:36 -05:00
parent 540050e084
commit 0954dc9217
No known key found for this signature in database
1 changed files with 12 additions and 0 deletions

View File

@ -181,6 +181,18 @@ export class TestDataDataSource extends DataSourceWithBackend<TestDataDataQuery>
const events = this.buildFakeAnnotationEvents(req.range, target.lines ?? 10);
const dataFrame = new ArrayDataFrame(events);
dataFrame.meta = { dataTopic: DataTopic.Annotations };
if (dataFrame.fields?.[1]) {
dataFrame.fields[1].config = {
...dataFrame.fields[1].config,
links: [
{
url: 'https://grafana.com',
title: 'Annotation Data link',
},
],
};
}
console.log('dataFrame', dataFrame);
return of({ key: target.refId, data: [dataFrame] }).pipe(delay(100));
}