Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ES|QL] Removes unused property from unified search #212772

Merged
merged 2 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/platform/packages/shared/kbn-esql-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export {
isESQLColumnSortable,
isESQLColumnGroupable,
isESQLFieldGroupable,
TextBasedLanguages,
sanitazeESQLInput,
queryCannotBeSampled,
mapVariableToColumn,
Expand Down
1 change: 0 additions & 1 deletion src/platform/packages/shared/kbn-esql-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export { TextBasedLanguages } from './types';
export { getESQLAdHocDataview, getIndexForESQLQuery } from './utils/get_esql_adhoc_dataview';
export { getInitialESQLQuery } from './utils/get_initial_esql_query';
export { getESQLWithSafeLimit } from './utils/get_esql_with_safe_limit';
Expand Down
12 changes: 0 additions & 12 deletions src/platform/packages/shared/kbn-esql-utils/src/types.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
import { DataViewType } from '@kbn/data-views-plugin/public';
import type { DataViewPickerProps } from '@kbn/unified-search-plugin/public';
import { ENABLE_ESQL } from '@kbn/esql-utils';
import { TextBasedLanguages } from '@kbn/esql-utils';
import { DiscoverFlyouts, dismissAllFlyoutsExceptFor } from '@kbn/discover-utils';
import { useSavedSearchInitial } from '../../state_management/discover_state_provider';
import { ESQL_TRANSITION_MODAL_KEY } from '../../../../../common/constants';
Expand Down Expand Up @@ -49,8 +47,7 @@ export const DiscoverTopNav = ({
onCancelClick,
}: DiscoverTopNavProps) => {
const services = useDiscoverServices();
const { dataViewEditor, navigation, dataViewFieldEditor, data, uiSettings, setHeaderActionMenu } =
services;
const { dataViewEditor, navigation, dataViewFieldEditor, data, setHeaderActionMenu } = services;
const query = useAppStateSelector((state) => state.query);
const { savedDataViews, managedDataViews, adHocDataViews } =
useInternalStateSelector(selectDataViewsForPicker);
Expand Down Expand Up @@ -174,9 +171,6 @@ export const DiscoverTopNav = ({
);

const dataViewPickerProps: DataViewPickerProps = useMemo(() => {
const isESQLModeEnabled = uiSettings.get(ENABLE_ESQL);
const supportedTextBasedLanguages = isESQLModeEnabled ? [TextBasedLanguages.ESQL] : [];

return {
trigger: {
label: dataView?.getName() || '',
Expand All @@ -188,7 +182,6 @@ export const DiscoverTopNav = ({
onDataViewCreated: createNewDataView,
onCreateDefaultAdHocDataView: stateContainer.actions.createAndAppendAdHocDataView,
onChangeDataView: stateContainer.actions.onChangeDataView,
textBasedLanguages: supportedTextBasedLanguages,
adHocDataViews,
managedDataViews,
savedDataViews,
Expand All @@ -202,7 +195,6 @@ export const DiscoverTopNav = ({
managedDataViews,
savedDataViews,
stateContainer,
uiSettings,
]);

const onESQLDocsFlyoutVisibilityChanged = useCallback((isOpen: boolean) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,6 @@ storiesOf('SearchBar', module)
onChangeDataView: action('onChangeDataView'),
onAddField: action('onAddField'),
onDataViewCreated: action('onDataViewCreated'),
textBasedLanguages: ['ESQL'],
},
} as SearchBarProps)
)
Expand All @@ -595,7 +594,6 @@ storiesOf('SearchBar', module)
onChangeDataView: action('onChangeDataView'),
onAddField: action('onAddField'),
onDataViewCreated: action('onDataViewCreated'),
textBasedLanguages: ['ESQL'],
},
query: { esql: 'from dataview | project field1, field2' },
} as unknown as SearchBarProps<Query>)
Expand All @@ -612,7 +610,6 @@ storiesOf('SearchBar', module)
onChangeDataView: action('onChangeDataView'),
onAddField: action('onAddField'),
onDataViewCreated: action('onDataViewCreated'),
textBasedLanguages: ['ESQL'],
},
query: {
esql: 'from dataview | project field1, field2, field 3, field 4, field 5 | where field5 > 5 | stats var = avg(field3)',
Expand All @@ -631,7 +628,6 @@ storiesOf('SearchBar', module)
onChangeDataView: action('onChangeDataView'),
onAddField: action('onAddField'),
onDataViewCreated: action('onDataViewCreated'),
textBasedLanguages: ['ESQL'],
},
textBasedLanguageModeErrors: [
new Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import React from 'react';
import type { EuiButtonProps, EuiSelectableProps } from '@elastic/eui';
import type { DataView, DataViewListItem, DataViewSpec } from '@kbn/data-views-plugin/public';
import { TextBasedLanguages } from '@kbn/esql-utils';
import { ChangeDataView } from './change_dataview';

export type ChangeDataViewTriggerProps = EuiButtonProps & {
Expand Down Expand Up @@ -69,12 +68,6 @@ export interface DataViewPickerProps {
onDataViewCreated?: () => void;

onCreateDefaultAdHocDataView?: (dataViewSpec: DataViewSpec) => void;
/**
* List of the supported text based languages (SQL, ESQL) etc.
* Defined per application, if not provided, no text based languages
* will be available.
*/
textBasedLanguages?: TextBasedLanguages[];
/**
* Makes the picker disabled by disabling the popover trigger
*/
Expand All @@ -93,7 +86,6 @@ export const DataViewPicker = ({
onDataViewCreated,
trigger,
selectableProps,
textBasedLanguages,
onCreateDefaultAdHocDataView,
isDisabled,
}: DataViewPickerProps) => {
Expand All @@ -111,7 +103,6 @@ export const DataViewPicker = ({
managedDataViews={managedDataViews}
savedDataViews={savedDataViews}
selectableProps={selectableProps}
textBasedLanguages={textBasedLanguages}
isDisabled={isDisabled}
/>
);
Expand Down