From d1ae4e278615a284c8fa1601f672a8555ff7c2d3 Mon Sep 17 00:00:00 2001 From: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com> Date: Fri, 14 Jul 2023 07:44:11 -0600 Subject: [PATCH] Explore: Replaced deprecated 'query' property with 'queries' in splitOpen (#71484) * Replace deprecated 'query' field with 'queries' * Replace another one * Queries is an array --- packages/grafana-data/src/utils/dataLinks.ts | 2 +- public/app/features/explore/ExplorePage.test.tsx | 2 +- public/app/features/explore/TraceView/TraceView.tsx | 10 ++++++---- public/app/features/explore/utils/links.test.ts | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/grafana-data/src/utils/dataLinks.ts b/packages/grafana-data/src/utils/dataLinks.ts index b0b47b0e373..14b27ade9bf 100644 --- a/packages/grafana-data/src/utils/dataLinks.ts +++ b/packages/grafana-data/src/utils/dataLinks.ts @@ -56,7 +56,7 @@ export function mapInternalLinkToExplore(options: LinkToExploreOptions): LinkMod ? () => { onClickFn({ datasourceUid: internalLink.datasourceUid, - query: interpolatedQuery, + queries: [interpolatedQuery], panelsState: interpolatedPanelsState, range, }); diff --git a/public/app/features/explore/ExplorePage.test.tsx b/public/app/features/explore/ExplorePage.test.tsx index 0ad7977e0a2..1e347163ad7 100644 --- a/public/app/features/explore/ExplorePage.test.tsx +++ b/public/app/features/explore/ExplorePage.test.tsx @@ -178,7 +178,7 @@ describe('ExplorePage', () => { }); act(() => { - store.dispatch(mainState.splitOpen({ datasourceUid: 'elastic', query: { expr: 'error', refId: 'A' } })); + store.dispatch(mainState.splitOpen({ datasourceUid: 'elastic', queries: [{ expr: 'error', refId: 'A' }] })); }); // Editor renders the new query diff --git a/public/app/features/explore/TraceView/TraceView.tsx b/public/app/features/explore/TraceView/TraceView.tsx index 4f93f022dce..f3afe636b0b 100644 --- a/public/app/features/explore/TraceView/TraceView.tsx +++ b/public/app/features/explore/TraceView/TraceView.tsx @@ -304,10 +304,12 @@ function useFocusSpanLink(options: { ? () => options.splitOpenFn({ datasourceUid: options.datasource?.uid!, - query: { - ...query!, - query: traceId, - }, + queries: [ + { + ...query!, + query: traceId, + }, + ], panelsState: { trace: { spanId, diff --git a/public/app/features/explore/utils/links.test.ts b/public/app/features/explore/utils/links.test.ts index 113e97c8dee..64d0e54d460 100644 --- a/public/app/features/explore/utils/links.test.ts +++ b/public/app/features/explore/utils/links.test.ts @@ -111,7 +111,7 @@ describe('explore links utils', () => { expect(splitfn).toBeCalledWith({ datasourceUid: 'uid_1', - query: { query: 'query_1' }, + queries: [{ query: 'query_1' }], range, panelsState: { trace: {