Skip to content

Commit

Permalink
[8.x] [ES|QL] Removes unused property from unified search (elastic#21…
Browse files Browse the repository at this point in the history
…2772) (elastic#212860)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] Removes unused property from unified search
(elastic#212772)](elastic#212772)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T09:08:34Z","message":"[ES|QL]
Removes unused property from unified search (elastic#212772)\n\n##
Summary\n\nClean ups the unified search props. (Leftovers from when we
had both\nES|QL and SQL in the dataview picker, now we have none of
them)","sha":"642e8f9622945742d0b7b03f5117b0558f667509","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:ES|QL","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL]
Removes unused property from unified
search","number":212772,"url":"https://github.com/elastic/kibana/pull/212772","mergeCommit":{"message":"[ES|QL]
Removes unused property from unified search (elastic#212772)\n\n##
Summary\n\nClean ups the unified search props. (Leftovers from when we
had both\nES|QL and SQL in the dataview picker, now we have none of
them)","sha":"642e8f9622945742d0b7b03f5117b0558f667509"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212772","number":212772,"mergeCommit":{"message":"[ES|QL]
Removes unused property from unified search (elastic#212772)\n\n##
Summary\n\nClean ups the unified search props. (Leftovers from when we
had both\nES|QL and SQL in the dataview picker, now we have none of
them)","sha":"642e8f9622945742d0b7b03f5117b0558f667509"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
  • Loading branch information
2 people authored and SoniaSanzV committed Mar 4, 2025
1 parent cd692b3 commit d532b0b
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 36 deletions.
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 @@ -182,9 +179,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 @@ -196,7 +190,6 @@ export const DiscoverTopNav = ({
onDataViewCreated: createNewDataView,
onCreateDefaultAdHocDataView: stateContainer.actions.createAndAppendAdHocDataView,
onChangeDataView: stateContainer.actions.onChangeDataView,
textBasedLanguages: supportedTextBasedLanguages,
adHocDataViews,
managedDataViews,
savedDataViews,
Expand All @@ -210,7 +203,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

0 comments on commit d532b0b

Please sign in to comment.