Skip to content

Commit

Permalink
updating query assists UI, fixing DSL breaking change
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Li <[email protected]>
  • Loading branch information
sejli committed Mar 22, 2024
1 parent 4e1e0e5 commit 5f25d9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 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 @@ -109,6 +108,16 @@ const emptyQueryCallOut = (
/>
);

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

export const QueryAssistInput: React.FC<React.PropsWithChildren<Props>> = (props) => {
// @ts-ignore
const queryRedux = useSelector(selectQueries)[props.tabId];
Expand Down Expand Up @@ -176,6 +185,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 +376,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 5f25d9d

Please sign in to comment.