Skip to content

Commit

Permalink
[SLOs] Create form trigger query on change (elastic#176905)
Browse files Browse the repository at this point in the history
## Summary

Fixes elastic#176892 !!

Create form trigger query on change !!
  • Loading branch information
shahzad31 authored Feb 14, 2024
1 parent c01ac61 commit e1c38ed
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ export function QueryBuilder({
query: kqlQuerySchema.is(field.value) ? String(field.value) : field.value.kqlQuery,
language: 'kuery',
}}
onQueryChange={(value) => {
if (kqlQuerySchema.is(field.value)) {
field.onChange(String(value.query?.query));
} else {
field.onChange({
...(field.value ?? {}),
kqlQuery: String(value.query?.query),
});
}
}}
onQuerySubmit={(value) => {
if (kqlQuerySchema.is(field.value)) {
field.onChange(String(value.query?.query));
Expand Down

0 comments on commit e1c38ed

Please sign in to comment.