From bf600b8361a65e9c5f65899ae61cc8c24676831d Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:30:30 -0700 Subject: [PATCH] Fix DSL router, update UI for query assist (#1612) (#1619) * updating query assists UI, fixing DSL breaking change * adding dismissible to callouts --------- (cherry picked from commit fae6f093899e4cc239353d889e2920a404ff65da) Signed-off-by: Sean Li Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../explorer/query_assist/input.tsx | 25 +++++++++++-------- server/routes/dsl.ts | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/public/components/event_analytics/explorer/query_assist/input.tsx b/public/components/event_analytics/explorer/query_assist/input.tsx index e6b18df585..a079cbfea0 100644 --- a/public/components/event_analytics/explorer/query_assist/input.tsx +++ b/public/components/event_analytics/explorer/query_assist/input.tsx @@ -5,7 +5,6 @@ import { EuiButton, - EuiButtonIcon, EuiCallOut, EuiComboBoxOptionOption, EuiFieldText, @@ -96,6 +95,7 @@ const prohibitedQueryCallOut = ( size="s" color="danger" iconType="alert" + dismissible /> ); @@ -106,6 +106,18 @@ const emptyQueryCallOut = ( size="s" color="warning" iconType="iInCircle" + dismissible + /> +); + +const pplGenerated = ( + ); @@ -176,6 +188,7 @@ export const QueryAssistInput: React.FC> = (props }, }) ); + setCallOut(pplGenerated); return generatedPPL; }; const formatError = (error: ResponseError | Error): Error => { @@ -366,16 +379,6 @@ export const QueryAssistInput: React.FC> = (props - - - {callOut} {props.children && } diff --git a/server/routes/dsl.ts b/server/routes/dsl.ts index 580a55152f..9bdc453427 100644 --- a/server/routes/dsl.ts +++ b/server/routes/dsl.ts @@ -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()), }), }, },