Skip to content

Commit

Permalink
add follow up issue comment
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <[email protected]>
  • Loading branch information
abbyhu2000 committed Dec 20, 2023
1 parent aaa775e commit 80ede38
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import {
EuiButtonEmpty,
EuiComboBox,
EuiComboBoxOptionOption,
EuiForm,
EuiFormRow,
EuiLink,
Expand All @@ -57,7 +58,6 @@ export function QueryLanguageSwitcher(props: Props) {
const opensearchDashboards = useOpenSearchDashboards<IDataPluginServices>();
const { application } = opensearchDashboards.services;
const currentApp$ = application?.currentAppId$;

let useNewQuerySelector;
application?.applications$.subscribe((applications) => {
applications.forEach((applicationEntry) => {
Expand Down Expand Up @@ -108,12 +108,14 @@ export function QueryLanguageSwitcher(props: Props) {
</EuiButtonEmpty>
);

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 (
<EuiComboBox
Expand Down

0 comments on commit 80ede38

Please sign in to comment.