@@ -2,9 +2,9 @@ import React, { ChangeEvent, ReactNode } from 'react';
22import { Button , Field , Form , Icon , InlineField , Input , Select } from '@grafana/ui' ;
33import { QueryEditorProps , SelectableValue } from '@grafana/data' ;
44import { DataSource } from '../datasource' ;
5- import { DEFAULT_QUERY , MyDataSourceOptions , MyQuery } from '../types' ;
5+ import { DEFAULT_QUERY , HaystackDataSourceOptions , HaystackQuery } from '../types' ;
66
7- type Props = QueryEditorProps < DataSource , MyQuery , MyDataSourceOptions > ;
7+ type Props = QueryEditorProps < DataSource , HaystackQuery , HaystackDataSourceOptions > ;
88
99export function QueryEditor ( { query, onChange, onRunQuery } : Props ) {
1010 const onTypeChange = ( event : SelectableValue < number > ) => {
@@ -78,7 +78,7 @@ export function QueryEditor({ query, onChange, onRunQuery }: Props) {
7878 return < p > Select a query type</ p >
7979 }
8080
81- function onSubmit ( newQuery : Partial < MyQuery > ) {
81+ function onSubmit ( newQuery : Partial < HaystackQuery > ) {
8282 query = { ...query , ...newQuery }
8383 onRunQuery ( ) ;
8484 }
@@ -88,11 +88,10 @@ export function QueryEditor({ query, onChange, onRunQuery }: Props) {
8888 < Form
8989 onSubmit = { onSubmit }
9090 > { ( { register, errors} ) => {
91- let queryComponent = renderQuery ( ) ;
9291 return (
9392 < div >
9493 < SelectComponent />
95- { queryComponent }
94+ { renderQuery ( ) }
9695 < Button type = "submit" > Run</ Button >
9796 </ div >
9897 )
0 commit comments