@grafana/scenes 5.16.4--canary.928.11176592185.0 → 5.17.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v5.17.0 (Fri Oct 04 2024)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Annotations: Include templateSrv.getVariables with dashboard object in legacy annotation queries [#929](https://github.com/grafana/scenes/pull/929) ([@kaydelaney](https://github.com/kaydelaney))
6
+
7
+ #### Authors: 1
8
+
9
+ - kay delaney ([@kaydelaney](https://github.com/kaydelaney))
10
+
11
+ ---
12
+
1
13
  # v5.16.3 (Thu Oct 03 2024)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -1,7 +1,7 @@
1
1
  import { from, of } from 'rxjs';
2
2
  import { map, mergeMap } from 'rxjs/operators';
3
3
  import { rangeUtil, CoreApp, DataTopic } from '@grafana/data';
4
- import { getRunRequest } from '@grafana/runtime';
4
+ import { getTemplateSrv, getRunRequest } from '@grafana/runtime';
5
5
  import { shouldUseLegacyRunner, standardAnnotationSupport } from './standardAnnotationsSupport.js';
6
6
  import { LoadingState } from '@grafana/schema';
7
7
  import { getEnrichedDataRequest } from '../../getEnrichedDataRequest.js';
@@ -39,7 +39,9 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
39
39
  range: timeRange.state.value,
40
40
  rangeRaw: timeRange.state.value.raw,
41
41
  annotation: query,
42
- dashboard: {}
42
+ dashboard: {
43
+ getVariables: getTemplateSrv().getVariables
44
+ }
43
45
  })
44
46
  ).pipe(
45
47
  map((events) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"standardAnnotationQuery.js","sources":["../../../../../src/querying/layers/annotations/standardAnnotationQuery.ts"],"sourcesContent":["import { from, Observable, of } from 'rxjs';\nimport { map, mergeMap } from 'rxjs/operators';\n\nimport {\n AnnotationEvent,\n AnnotationQuery,\n CoreApp,\n DataQueryRequest,\n DataSourceApi,\n DataTopic,\n PanelModel,\n rangeUtil,\n ScopedVars,\n} from '@grafana/data';\n\nimport { getRunRequest } from '@grafana/runtime';\nimport { shouldUseLegacyRunner, standardAnnotationSupport } from './standardAnnotationsSupport';\nimport { Dashboard, LoadingState } from '@grafana/schema';\nimport { SceneObject, SceneTimeRangeLike } from '../../../core/types';\nimport { getEnrichedDataRequest } from '../../getEnrichedDataRequest';\nimport { wrapInSafeSerializableSceneObject } from '../../../utils/wrapInSafeSerializableSceneObject';\n\nlet counter = 100;\nfunction getNextRequestId() {\n return 'AQ' + counter++;\n}\n\nexport interface AnnotationQueryOptions {\n dashboard: Dashboard;\n panel: PanelModel;\n}\n\nexport interface AnnotationQueryResults {\n state: LoadingState;\n events: AnnotationEvent[];\n}\n\nexport function executeAnnotationQuery(\n datasource: DataSourceApi,\n timeRange: SceneTimeRangeLike,\n query: AnnotationQuery,\n layer: SceneObject\n): Observable<AnnotationQueryResults> {\n // Check if we should use the old annotationQuery method\n if (datasource.annotationQuery && shouldUseLegacyRunner(datasource)) {\n console.warn('Using deprecated annotationQuery method, please upgrade your datasource');\n return from(\n datasource.annotationQuery({\n range: timeRange.state.value,\n rangeRaw: timeRange.state.value.raw,\n annotation: query,\n dashboard: {},\n })\n ).pipe(\n map((events) => ({\n state: LoadingState.Done,\n events,\n }))\n );\n }\n\n // Standard API for annotations support. Spread in datasource annotations support overrides\n const processor = {\n ...standardAnnotationSupport,\n ...datasource.annotations,\n };\n\n const annotationWithDefaults = {\n // Default query provided by a data source\n ...processor.getDefaultQuery?.(),\n ...query,\n };\n\n // Data source query migrations\n const annotation = processor.prepareAnnotation!(annotationWithDefaults);\n if (!annotation) {\n return of({\n state: LoadingState.Done,\n events: [],\n });\n }\n\n const processedQuery = processor.prepareQuery!(annotation);\n if (!processedQuery) {\n return of({\n state: LoadingState.Done,\n events: [],\n });\n }\n\n // No more points than pixels\n const maxDataPoints = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n\n // Add interval to annotation queries\n const interval = rangeUtil.calculateInterval(timeRange.state.value, maxDataPoints, datasource.interval);\n\n const scopedVars: ScopedVars = {\n __interval: { text: interval.interval, value: interval.interval },\n __interval_ms: { text: interval.intervalMs.toString(), value: interval.intervalMs },\n __annotation: { text: annotation.name, value: annotation },\n __sceneObject: wrapInSafeSerializableSceneObject(layer),\n };\n\n const queryRequest: DataQueryRequest = {\n startTime: Date.now(),\n requestId: getNextRequestId(),\n range: timeRange.state.value,\n maxDataPoints,\n scopedVars,\n ...interval,\n app: CoreApp.Dashboard,\n timezone: timeRange.getTimeZone(),\n targets: [\n {\n ...processedQuery,\n refId: 'Anno',\n },\n ],\n ...getEnrichedDataRequest(layer),\n };\n\n const runRequest = getRunRequest();\n\n return runRequest(datasource, queryRequest).pipe(\n mergeMap((panelData) => {\n // Some annotations set the topic already\n const data = panelData?.series.length ? panelData.series : panelData.annotations;\n\n if (!data?.length) {\n return of({\n state: panelData.state,\n events: [],\n });\n }\n\n // Add data topic to each frame\n data.forEach((frame) => {\n // If data topic has not been provided by the data source, make sure it's set correctly\n if (!frame.meta?.dataTopic) {\n frame.meta = { ...(frame.meta || {}), dataTopic: DataTopic.Annotations };\n }\n });\n\n return processor.processEvents!(annotation, data).pipe(\n map((events) => {\n return {\n state: panelData.state,\n events: events || [],\n };\n })\n );\n })\n );\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAI,OAAU,GAAA,GAAA,CAAA;AACd,SAAS,gBAAmB,GAAA;AAC1B,EAAA,OAAO,IAAO,GAAA,OAAA,EAAA,CAAA;AAChB,CAAA;AAYO,SAAS,sBACd,CAAA,UAAA,EACA,SACA,EAAA,KAAA,EACA,KACoC,EAAA;AA1CtC,EAAA,IAAA,EAAA,CAAA;AA4CE,EAAA,IAAI,UAAW,CAAA,eAAA,IAAmB,qBAAsB,CAAA,UAAU,CAAG,EAAA;AACnE,IAAA,OAAA,CAAQ,KAAK,yEAAyE,CAAA,CAAA;AACtF,IAAO,OAAA,IAAA;AAAA,MACL,WAAW,eAAgB,CAAA;AAAA,Q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AAA,GAAA,SAAA,CAAA,MAAA,CAAO,MAAS,IAAA,SAAA,CAAU,SAAS,SAAU,CAAA,WAAA,CAAA;AAErE,MAAI,IAAA,EAAC,6BAAM,MAAQ,CAAA,EAAA;AACjB,QAAA,OAAO,EAAG,CAAA;AAAA,UACR,OAAO,SAAU,CAAA,KAAA;AAAA,UACjB,QAAQ,EAAC;AAAA,SACV,CAAA,CAAA;AAAA,OACH;AAGA,MAAK,IAAA,CAAA,OAAA,CAAQ,CAAC,KAAU,KAAA;AAxI9B,QAAAA,IAAAA,GAAAA,CAAAA;AA0IQ,QAAA,IAAI,GAACA,GAAA,GAAA,KAAA,CAAM,IAAN,KAAA,IAAA,GAAA,KAAA,CAAA,GAAAA,IAAY,SAAW,CAAA,EAAA;AAC1B,UAAM,KAAA,CAAA,IAAA,GAAO,iCAAM,KAAM,CAAA,IAAA,IAAQ,EAApB,CAAA,EAAA,EAAyB,SAAW,EAAA,SAAA,CAAU,WAAY,EAAA,CAAA,CAAA;AAAA,SACzE;AAAA,OACD,CAAA,CAAA;AAED,MAAA,OAAO,SAAU,CAAA,aAAA,CAAe,UAAY,EAAA,IAAI,CAAE,CAAA,IAAA;AAAA,QAChD,GAAA,CAAI,CAAC,MAAW,KAAA;AACd,UAAO,OAAA;AAAA,YACL,OAAO,SAAU,CAAA,KAAA;AAAA,YACjB,MAAA,EAAQ,UAAU,EAAC;AAAA,WACrB,CAAA;AAAA,SACD,CAAA;AAAA,OACH,CAAA;AAAA,KACD,CAAA;AAAA,GACH,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"standardAnnotationQuery.js","sources":["../../../../../src/querying/layers/annotations/standardAnnotationQuery.ts"],"sourcesContent":["import { from, Observable, of } from 'rxjs';\nimport { map, mergeMap } from 'rxjs/operators';\n\nimport {\n AnnotationEvent,\n AnnotationQuery,\n CoreApp,\n DataQueryRequest,\n DataSourceApi,\n DataTopic,\n PanelModel,\n rangeUtil,\n ScopedVars,\n} from '@grafana/data';\n\nimport { getRunRequest, getTemplateSrv } from '@grafana/runtime';\nimport { shouldUseLegacyRunner, standardAnnotationSupport } from './standardAnnotationsSupport';\nimport { Dashboard, LoadingState } from '@grafana/schema';\nimport { SceneObject, SceneTimeRangeLike } from '../../../core/types';\nimport { getEnrichedDataRequest } from '../../getEnrichedDataRequest';\nimport { wrapInSafeSerializableSceneObject } from '../../../utils/wrapInSafeSerializableSceneObject';\n\nlet counter = 100;\nfunction getNextRequestId() {\n return 'AQ' + counter++;\n}\n\nexport interface AnnotationQueryOptions {\n dashboard: Dashboard;\n panel: PanelModel;\n}\n\nexport interface AnnotationQueryResults {\n state: LoadingState;\n events: AnnotationEvent[];\n}\n\nexport function executeAnnotationQuery(\n datasource: DataSourceApi,\n timeRange: SceneTimeRangeLike,\n query: AnnotationQuery,\n layer: SceneObject\n): Observable<AnnotationQueryResults> {\n // Check if we should use the old annotationQuery method\n if (datasource.annotationQuery && shouldUseLegacyRunner(datasource)) {\n console.warn('Using deprecated annotationQuery method, please upgrade your datasource');\n return from(\n datasource.annotationQuery({\n range: timeRange.state.value,\n rangeRaw: timeRange.state.value.raw,\n annotation: query,\n dashboard: {\n getVariables: getTemplateSrv().getVariables\n },\n })\n ).pipe(\n map((events) => ({\n state: LoadingState.Done,\n events,\n }))\n );\n }\n\n // Standard API for annotations support. Spread in datasource annotations support overrides\n const processor = {\n ...standardAnnotationSupport,\n ...datasource.annotations,\n };\n\n const annotationWithDefaults = {\n // Default query provided by a data source\n ...processor.getDefaultQuery?.(),\n ...query,\n };\n\n // Data source query migrations\n const annotation = processor.prepareAnnotation!(annotationWithDefaults);\n if (!annotation) {\n return of({\n state: LoadingState.Done,\n events: [],\n });\n }\n\n const processedQuery = processor.prepareQuery!(annotation);\n if (!processedQuery) {\n return of({\n state: LoadingState.Done,\n events: [],\n });\n }\n\n // No more points than pixels\n const maxDataPoints = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n\n // Add interval to annotation queries\n const interval = rangeUtil.calculateInterval(timeRange.state.value, maxDataPoints, datasource.interval);\n\n const scopedVars: ScopedVars = {\n __interval: { text: interval.interval, value: interval.interval },\n __interval_ms: { text: interval.intervalMs.toString(), value: interval.intervalMs },\n __annotation: { text: annotation.name, value: annotation },\n __sceneObject: wrapInSafeSerializableSceneObject(layer),\n };\n\n const queryRequest: DataQueryRequest = {\n startTime: Date.now(),\n requestId: getNextRequestId(),\n range: timeRange.state.value,\n maxDataPoints,\n scopedVars,\n ...interval,\n app: CoreApp.Dashboard,\n timezone: timeRange.getTimeZone(),\n targets: [\n {\n ...processedQuery,\n refId: 'Anno',\n },\n ],\n ...getEnrichedDataRequest(layer),\n };\n\n const runRequest = getRunRequest();\n\n return runRequest(datasource, queryRequest).pipe(\n mergeMap((panelData) => {\n // Some annotations set the topic already\n const data = panelData?.series.length ? panelData.series : panelData.annotations;\n\n if (!data?.length) {\n return of({\n state: panelData.state,\n events: [],\n });\n }\n\n // Add data topic to each frame\n data.forEach((frame) => {\n // If data topic has not been provided by the data source, make sure it's set correctly\n if (!frame.meta?.dataTopic) {\n frame.meta = { ...(frame.meta || {}), dataTopic: DataTopic.Annotations };\n }\n });\n\n return processor.processEvents!(annotation, data).pipe(\n map((events) => {\n return {\n state: panelData.state,\n events: events || [],\n };\n })\n );\n })\n );\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAI,OAAU,GAAA,GAAA,CAAA;AACd,SAAS,gBAAmB,GAAA;AAC1B,EAAA,OAAO,IAAO,GAAA,OAAA,EAAA,CAAA;AAChB,CAAA;AAYO,SAAS,sBACd,CAAA,UAAA,EACA,SACA,EAAA,KAAA,EACA,KACoC,EAAA;AA1CtC,EAAA,IAAA,EAAA,CAAA;AA4CE,EAAA,IAAI,UAAW,CAAA,eAAA,IAAmB,qBAAsB,CAAA,UAAU,CAAG,EAAA;AACnE,IAAA,OAAA,CAAQ,KAAK,yEAAyE,CAAA,CAAA;AACtF,IAAO,OAAA,IAAA;AAAA,MACL,WA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AAS,CAAC,SAAc,KAAA;AAEtB,MAAA,MAAM,QAAO,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,MAAA,CAAO,MAAS,IAAA,SAAA,CAAU,SAAS,SAAU,CAAA,WAAA,CAAA;AAErE,MAAI,IAAA,EAAC,6BAAM,MAAQ,CAAA,EAAA;AACjB,QAAA,OAAO,EAAG,CAAA;AAAA,UACR,OAAO,SAAU,CAAA,KAAA;AAAA,UACjB,QAAQ,EAAC;AAAA,SACV,CAAA,CAAA;AAAA,OACH;AAGA,MAAK,IAAA,CAAA,OAAA,CAAQ,CAAC,KAAU,KAAA;AA1I9B,QAAAA,IAAAA,GAAAA,CAAAA;AA4IQ,QAAA,IAAI,GAACA,GAAA,GAAA,KAAA,CAAM,IAAN,KAAA,IAAA,GAAA,KAAA,CAAA,GAAAA,IAAY,SAAW,CAAA,EAAA;AAC1B,UAAM,KAAA,CAAA,IAAA,GAAO,iCAAM,KAAM,CAAA,IAAA,IAAQ,EAApB,CAAA,EAAA,EAAyB,SAAW,EAAA,SAAA,CAAU,WAAY,EAAA,CAAA,CAAA;AAAA,SACzE;AAAA,OACD,CAAA,CAAA;AAED,MAAA,OAAO,SAAU,CAAA,aAAA,CAAe,UAAY,EAAA,IAAI,CAAE,CAAA,IAAA;AAAA,QAChD,GAAA,CAAI,CAAC,MAAW,KAAA;AACd,UAAO,OAAA;AAAA,YACL,OAAO,SAAU,CAAA,KAAA;AAAA,YACjB,MAAA,EAAQ,UAAU,EAAC;AAAA,WACrB,CAAA;AAAA,SACD,CAAA;AAAA,OACH,CAAA;AAAA,KACD,CAAA;AAAA,GACH,CAAA;AACF;;;;"}
package/dist/index.js CHANGED
@@ -7853,7 +7853,9 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
7853
7853
  range: timeRange.state.value,
7854
7854
  rangeRaw: timeRange.state.value.raw,
7855
7855
  annotation: query,
7856
- dashboard: {}
7856
+ dashboard: {
7857
+ getVariables: runtime.getTemplateSrv().getVariables
7858
+ }
7857
7859
  })
7858
7860
  ).pipe(
7859
7861
  operators.map((events) => ({