Skip to content

Commit b8c2319

Browse files
committed
Fix VariableQueryEditor style
1 parent 91513dc commit b8c2319

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/components/VariableQueryEditor.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import React, { useEffect, useState } from 'react';
2-
import { InlineField, Input, Alert, Button } from '@grafana/ui';
3-
4-
import { EditorRow, EditorRows } from '@grafana/plugin-ui';
2+
import { InlineField, Input, Alert, Button, InlineFieldRow } from '@grafana/ui';
53
import { QueryEditorProps } from '@grafana/data';
64
import { MongoDataSourceOptions, MongoDBQuery, MongoDBVariableQuery, QueryType } from '../types';
75
import { QueryEditorRaw } from './QueryEditorRaw';
@@ -26,8 +24,8 @@ export const VariableQueryEditor = ({ onChange, query }: VariableQueryEditorProp
2624
}, [query]);
2725

2826
return (
29-
<EditorRows>
30-
<EditorRow>
27+
<div>
28+
<InlineFieldRow style={{ justifyContent: 'space-between' }}>
3129
<InlineField
3230
label="Collection"
3331
tooltip="Name of MongoDB collection to query"
@@ -43,13 +41,16 @@ export const VariableQueryEditor = ({ onChange, query }: VariableQueryEditorProp
4341
></Input>
4442
</InlineField>
4543
<Button
46-
onClick={() => {
47-
onChange({ queryText: queryText, queryType: QueryType.TABLE, refId: refId, collection: collection });
48-
}}
44+
icon="play"
45+
variant="primary"
46+
size="sm"
47+
onClick={() =>
48+
onChange({ queryText: queryText, queryType: QueryType.TABLE, refId: refId, collection: collection })
49+
}
4950
>
5051
Save and Query
5152
</Button>
52-
</EditorRow>
53+
</InlineFieldRow>
5354
<QueryEditorRaw
5455
query={queryText}
5556
language="json"
@@ -61,6 +62,6 @@ export const VariableQueryEditor = ({ onChange, query }: VariableQueryEditorProp
6162
The query result is expected to contain <code>value</code> field which has elements of type <code>string</code>{' '}
6263
or <code>number</code>
6364
</Alert>
64-
</EditorRows>
65+
</div>
6566
);
6667
};

src/datasource.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export class MongoDBDataSource extends DataSourceWithBackend<MongoDBQuery, Mongo
1717
}
1818

1919
applyTemplateVariables(query: MongoDBQuery, scopedVars: ScopedVars) {
20-
console.log("scopedVars", scopedVars);
2120
const variables = { ...scopedVars };
2221

2322
let queryText = query.queryText!;

src/variables.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export class MongoDBVariableSupport extends CustomVariableSupport<MongoDBDataSou
2020
}
2121

2222
const dataframe = response.data[0] as DataFrameSchema;
23-
console.log(dataframe);
2423
const field = dataframe.fields.find((f) => f.name === 'value');
2524

2625
if (!field) {

0 commit comments

Comments
 (0)