Skip to content

Commit 38b5ee1

Browse files
chore: Removes deprecated Form
1 parent d46cef4 commit 38b5ee1

File tree

1 file changed

+16
-28
lines changed

1 file changed

+16
-28
lines changed

src/components/QueryEditor.tsx

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { } from 'react';
2-
import { Button, Form, Stack } from '@grafana/ui';
2+
import { Stack } from '@grafana/ui';
33
import { QueryEditorProps } from '@grafana/data';
44
import { DataSource } from '../datasource';
55
import { HaystackDataSourceOptions, HaystackQuery } from '../types';
@@ -24,33 +24,21 @@ export function QueryEditor({ datasource, query, onChange, onRunQuery }: Props)
2424
}
2525
};
2626

27-
function onSubmit(newQuery: Partial<HaystackQuery>) {
28-
query = { ...query, ...newQuery };
29-
onRunQuery();
30-
}
31-
3227
return (
33-
<Form onSubmit={onSubmit}>
34-
{({ register, errors }) => {
35-
return (
36-
<Stack
37-
direction="column"
38-
alignItems="flex-start"
39-
>
40-
<HaystackQueryTypeSelector
41-
datasource={datasource}
42-
type={query.type}
43-
refId={query.refId}
44-
onChange={onTypeChange}
45-
/>
46-
<HaystackQueryInput
47-
query={query}
48-
onChange={onQueryChange}
49-
/>
50-
<Button type="submit" >Run</Button>
51-
</Stack>
52-
);
53-
}}
54-
</Form>
28+
<Stack
29+
direction="column"
30+
alignItems="flex-start"
31+
>
32+
<HaystackQueryTypeSelector
33+
datasource={datasource}
34+
type={query.type}
35+
refId={query.refId}
36+
onChange={onTypeChange}
37+
/>
38+
<HaystackQueryInput
39+
query={query}
40+
onChange={onQueryChange}
41+
/>
42+
</Stack>
5543
);
5644
}

0 commit comments

Comments
 (0)