Skip to content

Commit

Permalink
Fix DSL router, update UI for query assist (#1612) (#1619)
Browse files Browse the repository at this point in the history
* updating query assists UI, fixing DSL breaking change



* adding dismissible to callouts



---------


(cherry picked from commit fae6f09)

Signed-off-by: Sean Li <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 8829587 commit bf600b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 14 additions & 11 deletions public/components/event_analytics/explorer/query_assist/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import {
EuiButton,
EuiButtonIcon,
EuiCallOut,
EuiComboBoxOptionOption,
EuiFieldText,
Expand Down Expand Up @@ -96,6 +95,7 @@ const prohibitedQueryCallOut = (
size="s"
color="danger"
iconType="alert"
dismissible
/>
);

Expand All @@ -106,6 +106,18 @@ const emptyQueryCallOut = (
size="s"
color="warning"
iconType="iInCircle"
dismissible
/>
);

const pplGenerated = (
<EuiCallOut
data-test-subj="query-assist-ppl-callout"
title="PPL query generated"
size="s"
color="success"
iconType="check"
dismissible
/>
);

Expand Down Expand Up @@ -176,6 +188,7 @@ export const QueryAssistInput: React.FC<React.PropsWithChildren<Props>> = (props
},
})
);
setCallOut(pplGenerated);
return generatedPPL;
};
const formatError = (error: ResponseError | Error): Error => {
Expand Down Expand Up @@ -366,16 +379,6 @@ export const QueryAssistInput: React.FC<React.PropsWithChildren<Props>> = (props
</EuiListGroup>
</EuiInputPopover>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
iconType="returnKey"
display={props.lastFocusedInput === 'nlq_input' ? 'fill' : 'base'}
isDisabled={loading}
onClick={runAndSummarize}
size="m"
aria-label="submit-question"
/>
</EuiFlexItem>
</EuiFlexGroup>
{callOut}
{props.children && <EuiSpacer size="s" />}
Expand Down
2 changes: 1 addition & 1 deletion server/routes/dsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function registerDslRoute({ router }: { router: IRouter; facet: DSLFacet
validate: {
query: schema.object({
format: schema.string(),
index: schema.string(),
index: schema.maybe(schema.string()),
}),
},
},
Expand Down

0 comments on commit bf600b8

Please sign in to comment.