From 80ede3803aea5f3f4ea252f826c3c49f1d30e335 Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Wed, 20 Dec 2023 22:48:25 +0000 Subject: [PATCH] add follow up issue comment Signed-off-by: abbyhu2000 --- .../data/public/ui/query_string_input/language_switcher.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/data/public/ui/query_string_input/language_switcher.tsx b/src/plugins/data/public/ui/query_string_input/language_switcher.tsx index 5ae279282735..2a7aade04ed5 100644 --- a/src/plugins/data/public/ui/query_string_input/language_switcher.tsx +++ b/src/plugins/data/public/ui/query_string_input/language_switcher.tsx @@ -31,6 +31,7 @@ import { EuiButtonEmpty, EuiComboBox, + EuiComboBoxOptionOption, EuiForm, EuiFormRow, EuiLink, @@ -57,7 +58,6 @@ export function QueryLanguageSwitcher(props: Props) { const opensearchDashboards = useOpenSearchDashboards(); const { application } = opensearchDashboards.services; const currentApp$ = application?.currentAppId$; - let useNewQuerySelector; application?.applications$.subscribe((applications) => { applications.forEach((applicationEntry) => { @@ -108,12 +108,14 @@ export function QueryLanguageSwitcher(props: Props) { ); - const handleLanguageChange = (newLanguage: any) => { + const handleLanguageChange = (newLanguage: EuiComboBoxOptionOption[]) => { const queryLanguage = newLanguage[0].label === 'DQL' ? 'kuery' : newLanguage[0].label; props.onSelectLanguage(queryLanguage); setSelectedLanguage(newLanguage); }; + // The following is a temporary solution for adding PPL navigation, and should be replaced once final solution is determined. + // Follow-up issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5628 if (useObservable(currentApp$!, '') === 'data-explorer' && useNewQuerySelector) { return (