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 <abigailhu2000@gmail.com>
  • 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);

Check warning on line 114 in src/plugins/data/public/ui/query_string_input/language_switcher.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/data/public/ui/query_string_input/language_switcher.tsx#L113-L114

Added lines #L113 - L114 were not covered by tests
};

// 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 (

Check warning on line 120 in src/plugins/data/public/ui/query_string_input/language_switcher.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/data/public/ui/query_string_input/language_switcher.tsx#L120

Added line #L120 was not covered by tests
<EuiComboBox
Expand Down

0 comments on commit 80ede38

Please sign in to comment.