Skip to content

Commit 12db1bb

Browse files
authored
Add RefId to Query as mandatory for the upcoming release (#55)
* Add RefId to Query as required in the Grafana master * Fix tests
1 parent 37c267a commit 12db1bb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/components/root-page/root-page.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react';
21
import { shallow } from 'enzyme';
2+
import React from 'react';
33
import { Observable } from 'rxjs';
44
import { AppPluginMeta, PluginType } from '@grafana/data';
55
import { InfoBox } from '@grafana/ui';
@@ -137,7 +137,7 @@ describe('RootPage', () => {
137137

138138
setImmediate(() => {
139139
expect(getRedisMock).toHaveBeenCalledWith('redis');
140-
expect(redisMock.query).toHaveBeenCalledWith({ targets: [{ query: RedisCommand.COMMAND }] });
140+
expect(redisMock.query).toHaveBeenCalledWith({ targets: [{ refId: 'A', query: RedisCommand.COMMAND }] });
141141
expect(wrapper.state().loading).toBeFalsy();
142142
expect(wrapper.state().dataSources).toEqual([
143143
{

src/components/root-page/root-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class RootPage extends PureComponent<Props, State> {
104104
* Execute query
105105
*/
106106
const query = (redis.query({
107-
targets: [{ query: RedisCommand.COMMAND }],
107+
targets: [{ refId: 'A', query: RedisCommand.COMMAND }],
108108
} as DataQueryRequest<RedisQuery>) as unknown) as Observable<DataQueryResponse>;
109109

110110
if (!query.toPromise) {

src/redis-cli-panel/components/redis-cli-panel/redis-cli-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const RedisCLIPanel: React.FC<PanelProps<PanelOptions>> = ({
6565
* Run Query
6666
*/
6767
const res = await ((ds.query({
68-
targets: [{ query: replaceVariables(query), cli: !options.raw }],
68+
targets: [{ refId: 'A', query: replaceVariables(query), cli: !options.raw }],
6969
} as DataQueryRequest<RedisQuery>) as unknown) as Observable<DataQueryResponse>)
7070
.pipe(
7171
switchMap$((response) => {

0 commit comments

Comments
 (0)