Explore: Replaced deprecated 'query' property with 'queries' in splitOpen (#71484)

* Replace deprecated 'query' field with 'queries'

* Replace another one

* Queries is an array
This commit is contained in:
Haris Rozajac
2023-07-14 07:44:11 -06:00
committed by GitHub
parent dc4cedd298
commit d1ae4e2786
4 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ export function mapInternalLinkToExplore(options: LinkToExploreOptions): LinkMod
? () => { ? () => {
onClickFn({ onClickFn({
datasourceUid: internalLink.datasourceUid, datasourceUid: internalLink.datasourceUid,
query: interpolatedQuery, queries: [interpolatedQuery],
panelsState: interpolatedPanelsState, panelsState: interpolatedPanelsState,
range, range,
}); });
@@ -178,7 +178,7 @@ describe('ExplorePage', () => {
}); });
act(() => { 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 // Editor renders the new query
@@ -304,10 +304,12 @@ function useFocusSpanLink(options: {
? () => ? () =>
options.splitOpenFn({ options.splitOpenFn({
datasourceUid: options.datasource?.uid!, datasourceUid: options.datasource?.uid!,
query: { queries: [
...query!, {
query: traceId, ...query!,
}, query: traceId,
},
],
panelsState: { panelsState: {
trace: { trace: {
spanId, spanId,
@@ -111,7 +111,7 @@ describe('explore links utils', () => {
expect(splitfn).toBeCalledWith({ expect(splitfn).toBeCalledWith({
datasourceUid: 'uid_1', datasourceUid: 'uid_1',
query: { query: 'query_1' }, queries: [{ query: 'query_1' }],
range, range,
panelsState: { panelsState: {
trace: { trace: {