grafana/public/app/plugins/datasource/loki/components/LokiExploreQueryEditor.tsx
Ivana Huckova a54e0ff79d
Loki: Add query type and line limit to query editor in dashboard (#29356)
* WIP Add line limit and query type switch toLoki dashboard editor

* Refactor, reuse code for both - Explore and Dashboard

* Üpdate snapshot tests

* Refactor and unify

* Rename test file

* Update test
2020-12-01 20:43:35 +01:00

31 lines
791 B
TypeScript

// Libraries
import React, { memo } from 'react';
import _ from 'lodash';
// Types
import { ExploreQueryFieldProps } from '@grafana/data';
import { LokiDatasource } from '../datasource';
import { LokiQuery, LokiOptions } from '../types';
import { LokiQueryField } from './LokiQueryField';
type Props = ExploreQueryFieldProps<LokiDatasource, LokiQuery, LokiOptions>;
export function LokiExploreQueryEditor(props: Props) {
const { range, query, data, datasource, history, onChange, onRunQuery } = props;
return (
<LokiQueryField
datasource={datasource}
query={query}
onChange={onChange}
onBlur={() => {}}
onRunQuery={onRunQuery}
history={history}
data={data}
range={range}
/>
);
}
export default memo(LokiExploreQueryEditor);