From 316bea9fe9f2ffab9a80c7eb52d9faee2597c947 Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Wed, 28 Aug 2024 22:53:42 +0000 Subject: [PATCH] address comments Signed-off-by: abbyhu2000 --- src/plugins/data/public/index.ts | 1 - src/plugins/data/public/query/query_string/index.ts | 1 - .../language_service/default_language_reference.tsx | 3 +-- .../language_service/get_query_control_links.tsx | 6 ++++-- .../public/query/query_string/language_service/index.ts | 1 - .../query/query_string/language_service/language_service.ts | 6 +++++- .../public/query_editor/query_language_reference.tsx | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index 7f75f39e2245..f2696e824112 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -481,7 +481,6 @@ export { QueryStateChange, QueryStart, PersistedLog, - QueryControl, } from './query'; export { AggsStart } from './search/aggs'; diff --git a/src/plugins/data/public/query/query_string/index.ts b/src/plugins/data/public/query/query_string/index.ts index fc3ab5328e4e..9e5b584a5e2e 100644 --- a/src/plugins/data/public/query/query_string/index.ts +++ b/src/plugins/data/public/query/query_string/index.ts @@ -35,5 +35,4 @@ export { LanguageService, LanguageConfig, EditorEnhancements, - QueryControl, } from './language_service'; diff --git a/src/plugins/data/public/query/query_string/language_service/default_language_reference.tsx b/src/plugins/data/public/query/query_string/language_service/default_language_reference.tsx index e0587a33266f..56dda2550426 100644 --- a/src/plugins/data/public/query/query_string/language_service/default_language_reference.tsx +++ b/src/plugins/data/public/query/query_string/language_service/default_language_reference.tsx @@ -56,8 +56,7 @@ export const DefaultLanguageReference = () => {

diff --git a/src/plugins/data/public/query/query_string/language_service/get_query_control_links.tsx b/src/plugins/data/public/query/query_string/language_service/get_query_control_links.tsx index df8d9f6d4251..80898d5468b7 100644 --- a/src/plugins/data/public/query/query_string/language_service/get_query_control_links.tsx +++ b/src/plugins/data/public/query/query_string/language_service/get_query_control_links.tsx @@ -9,8 +9,10 @@ import { EuiFlexItem } from '@elastic/eui'; export const QueryControls = (props: { queryControls: React.ReactElement[] }) => { return ( <> - {props.queryControls.map((queryControl) => ( - {queryControl} + {props.queryControls.map((queryControl, idx) => ( + + {queryControl} + ))} ); diff --git a/src/plugins/data/public/query/query_string/language_service/index.ts b/src/plugins/data/public/query/query_string/language_service/index.ts index ec075f0a718c..79aea071de3f 100644 --- a/src/plugins/data/public/query/query_string/language_service/index.ts +++ b/src/plugins/data/public/query/query_string/language_service/index.ts @@ -5,4 +5,3 @@ export * from './types'; export { LanguageServiceContract, LanguageService } from './language_service'; -export { QueryControl } from './get_query_control_links'; diff --git a/src/plugins/data/public/query/query_string/language_service/language_service.ts b/src/plugins/data/public/query/query_string/language_service/language_service.ts index 539b01c29eff..113a85e25e10 100644 --- a/src/plugins/data/public/query/query_string/language_service/language_service.ts +++ b/src/plugins/data/public/query/query_string/language_service/language_service.ts @@ -35,6 +35,10 @@ export class LanguageService { } }; + public createDefaultLanguageReference = () => { + return createDefaultLanguageReference(); + }; + /** * Registers default handlers for index patterns and indices. */ @@ -42,7 +46,7 @@ export class LanguageService { const defaultEditor = createEditor( SingleLineInput, SingleLineInput, - [createDefaultLanguageReference()], + [this.createDefaultLanguageReference()], DQLBody ); this.registerLanguage(getDQLLanguageConfig(this.defaultSearchInterceptor, defaultEditor)); diff --git a/src/plugins/query_enhancements/public/query_editor/query_language_reference.tsx b/src/plugins/query_enhancements/public/query_editor/query_language_reference.tsx index 33cbc6f975d8..4ec2abd8da22 100644 --- a/src/plugins/query_enhancements/public/query_editor/query_language_reference.tsx +++ b/src/plugins/query_enhancements/public/query_editor/query_language_reference.tsx @@ -36,7 +36,7 @@ export class QueryLanguageReference { toMountPoint( flyoutSession?.close?.().then()} + onClose={() => flyoutSession?.close()} makeUrl={(searchId: any) => `#/view/${encodeURIComponent(searchId)}`} />