Skip to content

Commit

Permalink
Revert "Remove unsupported languages for dataset (opensearch-project#…
Browse files Browse the repository at this point in the history
…8100) (opensearch-project#8262)"

This reverts commit cb3b4f6.
  • Loading branch information
abbyhu2000 committed Sep 24, 2024
1 parent 42c15f5 commit 16da35b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 0 additions & 2 deletions changelogs/fragments/8100.yml

This file was deleted.

12 changes: 2 additions & 10 deletions src/plugins/data/public/ui/query_editor/language_selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ export const QueryLanguageSelector = (props: QueryLanguageSelectorProps) => {
const queryString = getQueryService().queryString;
const languageService = queryString.getLanguageService();

const datasetSupportedLanguages = props.query.dataset
? queryString
.getDatasetService()
.getType(props.query.dataset.type)
?.supportedLanguages(props.query.dataset)
: undefined;

useEffect(() => {
const subscription = queryString.getUpdates$().subscribe((query: Query) => {
if (query.language !== currentLanguage) {
Expand All @@ -64,11 +57,10 @@ export const QueryLanguageSelector = (props: QueryLanguageSelectorProps) => {
languageService.getLanguages().forEach((language) => {
if (
(language && props.appName && !language.editorSupportedAppNames?.includes(props.appName)) ||
languageService.getUserQueryLanguageBlocklist().includes(language?.id) ||
(datasetSupportedLanguages && !datasetSupportedLanguages.includes(language.id))
languageService.getUserQueryLanguageBlocklist().includes(language?.id)
)
return;
languageOptions.unshift(mapExternalLanguageToOptions(language));
languageOptions.unshift(mapExternalLanguageToOptions(language!));
});

const selectedLanguage = {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/public/ui/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { QueryStatus } from '../query';
import { IndexPatternSelectProps } from './index_pattern_select';
import { StatefulSearchBarProps } from './search_bar';
import { SuggestionsComponentProps } from './typeahead/suggestions_component';
Expand Down

0 comments on commit 16da35b

Please sign in to comment.