From e6db812181db0c54b7d623090012b94329e91ad0 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 11:59:08 -0600 Subject: [PATCH 01/21] only show range when control type is range slider --- .../controls/controls-constants/index.ts | 1 + .../src/control_constants.ts | 2 ++ .../editor/configure_values_query.tsx | 4 ++++ .../editor/data_control_editor.tsx | 23 ++++++++++++++----- .../editor/esql_values_preview.test.tsx | 20 +++++++++++++++- .../editor/esql_values_preview.tsx | 8 +++++-- 6 files changed, 49 insertions(+), 9 deletions(-) diff --git a/src/platform/packages/shared/controls/controls-constants/index.ts b/src/platform/packages/shared/controls/controls-constants/index.ts index eefabb380a74a..a3ab57265fb0c 100644 --- a/src/platform/packages/shared/controls/controls-constants/index.ts +++ b/src/platform/packages/shared/controls/controls-constants/index.ts @@ -26,6 +26,7 @@ export { ControlValuesSource, SELECTIONS_MAX, } from './src/control_constants'; +export type { DataControlType } from './src/control_constants'; export { DEFAULT_DSL_OPTIONS_LIST_STATE, DEFAULT_ESQL_OPTIONS_LIST_STATE, diff --git a/src/platform/packages/shared/controls/controls-constants/src/control_constants.ts b/src/platform/packages/shared/controls/controls-constants/src/control_constants.ts index 6c073cd0bf9e5..a011f17e0013c 100644 --- a/src/platform/packages/shared/controls/controls-constants/src/control_constants.ts +++ b/src/platform/packages/shared/controls/controls-constants/src/control_constants.ts @@ -13,6 +13,8 @@ export const OPTIONS_LIST_CONTROL = 'options_list_control'; export const RANGE_SLIDER_CONTROL = 'range_slider_control'; export const TIME_SLIDER_CONTROL = 'time_slider_control'; +export type DataControlType = typeof OPTIONS_LIST_CONTROL | typeof RANGE_SLIDER_CONTROL; + export const DEFAULT_DATA_CONTROL_STATE = { use_global_filters: true, ignore_validations: false, diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx index 4909a21fdad30..cc0a979bb52a8 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx @@ -18,6 +18,7 @@ import type { ESQLColumn } from '@kbn/es-types'; import type { ESQLControlVariable } from '@kbn/esql-types'; import { apiCanAddNewPanel, apiCanPinPanels } from '@kbn/presentation-publishing'; import { DEFAULT_ESQL_OPTIONS_LIST_STATE, ESQL_CONTROL } from '@kbn/controls-constants'; +import type { DataControlType } from '@kbn/controls-constants'; import { dataService } from '../../../services/kibana_services'; import { getESQLSingleColumnValues } from '../../../../common/options_list'; import { getControlsTimezone } from '../../utils'; @@ -32,6 +33,7 @@ interface ConfigureValuesQueryProps { isEdit: boolean; esqlVariables?: ESQLControlVariable[]; parentApi?: unknown; + selectedControlType?: DataControlType; // Re-opens the parent data control editor flyout. Used after the inner ESQL variable // control creation flyout closes reopenEditor?: (overrides?: Partial) => void; @@ -44,6 +46,7 @@ export const ConfigureValuesQuery = ({ isEdit, esqlVariables = [], parentApi, + selectedControlType, reopenEditor, }: ConfigureValuesQueryProps) => { const [previewOptions, setPreviewOptions] = useState([]); @@ -207,6 +210,7 @@ export const ConfigureValuesQuery = ({ updateQuery={appendColumnToESQLQuery} isQueryRunning={isPreviewQueryRunning} dataSource={dataSource} + selectedControlType={selectedControlType} /> ); diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx index 7f5a52e7d0d05..556141b446eb7 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx @@ -44,6 +44,7 @@ import { KbnDangerCallout } from '@kbn/ui-callout'; import { triggers } from '@kbn/ui-actions-plugin/public'; import { CONTROL_MENU_TRIGGER } from '@kbn/ui-actions-plugin/common/trigger_ids'; import { ControlValuesSource, DEFAULT_CONTROL_VALUES_SOURCE } from '@kbn/controls-constants'; +import type { DataControlType } from '@kbn/controls-constants'; import { useStateFromPublishingSubject } from '@kbn/presentation-publishing'; import type { PublishesESQLVariables } from '@kbn/esql-types'; import { type CreateControlTypeAction } from '../../../actions/control_panel_actions'; @@ -59,7 +60,7 @@ import { ConfigureValuesQuery } from './configure_values_query'; export interface ControlEditorProps { initialState: Partial; - controlType?: string; + controlType?: DataControlType; controlId?: string; initialDefaultPanelTitle?: string; parentApi: unknown; @@ -111,8 +112,8 @@ const CompatibleControlTypesComponent = ({ selectedControlType: selectedAction, setSelectedControlType: setSelectedAction, }: Partial & { - selectedControlType?: string; - setSelectedControlType: (type: string) => void; + selectedControlType?: DataControlType; + setSelectedControlType: (type: DataControlType) => void; }) => { const controlActionRegistry = useControlActionRegistry(); const [isCompatible, setIsCompatible] = useState<{ [type: string]: boolean }>({}); @@ -162,7 +163,11 @@ const CompatibleControlTypesComponent = ({ data-test-subj={`create__${action.type}`} isSelected={action.type === selectedAction} disabled={disabled} - onClick={() => setSelectedAction(action.type)} + onClick={() => + setSelectedAction( + action.type as DataControlType + ) + } label={action.getDisplayName(controlTypeContext)} > (initialState.title ?? defaultPanelTitle); - const [selectedControlType, setSelectedControlType] = useState(controlType); + const [selectedControlType, setSelectedControlType] = useState( + controlType + ); const [controlOptionsValid, setControlOptionsValid] = useState(true); const editorConfig = useMemo(() => { @@ -335,7 +342,10 @@ export const DataControlEditor = diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.test.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.test.tsx index 7798964ca5cff..6adf758d75f99 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.test.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.test.tsx @@ -11,6 +11,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { I18nProvider } from '@kbn/i18n-react'; import type { ESQLColumn } from '@kbn/es-types'; +import { RANGE_SLIDER_CONTROL, OPTIONS_LIST_CONTROL } from '@kbn/controls-constants'; import { ESQLValuesPreview } from './esql_values_preview'; const noopProps = { @@ -24,13 +25,14 @@ const numericColumn: ESQLColumn = { name: 'bytes', type: 'long' }; const stringColumn: ESQLColumn = { name: 'os', type: 'keyword' }; describe('ESQLValuesPreview', () => { - it('renders min/max stats for numeric columns', () => { + it('renders min/max stats for numeric columns when control type is range slider', () => { const { getByText, getByTestId } = render( ); @@ -39,6 +41,22 @@ describe('ESQLValuesPreview', () => { expect(getByText('6')).toBeInTheDocument(); expect(getByText('67')).toBeInTheDocument(); }); + + it('renders a list of values for numeric columns when control type is options list', () => { + const { getByTestId, queryByTestId } = render( + + + + ); + + expect(queryByTestId('esqlValuesPreviewRange')).not.toBeInTheDocument(); + expect(getByTestId('esqlValuesPreviewStrings')).toBeInTheDocument(); + }); it('renders a list of values for string columns', () => { const { getByTestId } = render( diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx index d291b31082cb1..986984e1fc48d 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx @@ -28,6 +28,8 @@ import { max, min } from 'lodash'; import type { ESQLColumn } from '@kbn/es-types'; import { isNumericType } from '@kbn/esql-language'; import { EMPTY_LABEL } from '@kbn/field-formats-common'; +import { RANGE_SLIDER_CONTROL } from '@kbn/controls-constants'; +import type { DataControlType } from '@kbn/controls-constants'; import { ChooseColumnPopover } from './choose_column_popover'; import { DataControlEditorStrings } from '../data_control_constants'; @@ -39,6 +41,7 @@ export const ESQLValuesPreview: React.FC<{ queryNeedsRunning: boolean; isQueryRunning: boolean; dataSource: string; + selectedControlType?: DataControlType; }> = ({ previewOptions, previewError, @@ -47,6 +50,7 @@ export const ESQLValuesPreview: React.FC<{ queryNeedsRunning, isQueryRunning, dataSource, + selectedControlType, }) => { const isEmpty = useMemo(() => previewOptions.length === 0, [previewOptions]); @@ -57,12 +61,12 @@ export const ESQLValuesPreview: React.FC<{ ); const range = useMemo(() => { - if (isNumericType(singleColumn?.type)) { + if (selectedControlType === RANGE_SLIDER_CONTROL && isNumericType(singleColumn?.type)) { const optionsAsNumbers = previewOptions.map((v) => Number(v)); return { min: min(optionsAsNumbers), max: max(optionsAsNumbers) }; } return null; - }, [previewOptions, singleColumn]); + }, [previewOptions, selectedControlType, singleColumn]); const body = previewError ? ( Date: Fri, 11 Sep 2026 12:02:33 -0600 Subject: [PATCH 02/21] remove unneeded EuiPanel wrappers --- .../editor/esql_values_preview.tsx | 83 +++++++------------ 1 file changed, 28 insertions(+), 55 deletions(-) diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx index 986984e1fc48d..161d27771fa6b 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx @@ -69,69 +69,42 @@ export const ESQLValuesPreview: React.FC<{ }, [previewOptions, selectedControlType, singleColumn]); const body = previewError ? ( - - -

{previewError.message}

-
-
+

{previewError.message}

+ ) : multiColumnResult ? ( - - -

- {DataControlEditorStrings.manageControl.dataSource.valuesPreview.getMultiColumnErrorBody( - previewColumns.length - )} -

- -
-
+

+ {DataControlEditorStrings.manageControl.dataSource.valuesPreview.getMultiColumnErrorBody( + previewColumns.length + )} +

+ + ) : isEmpty ? ( - - -

{DataControlEditorStrings.manageControl.dataSource.valuesPreview.getEmptyText()}

-
-
+

{DataControlEditorStrings.manageControl.dataSource.valuesPreview.getEmptyText()}

+ ) : range ? ( Date: Fri, 11 Sep 2026 13:45:14 -0600 Subject: [PATCH 03/21] move other stuff out of preview_value --- .../editor/configure_values_query.tsx | 86 +++++++- .../editor/esql_values_preview.test.tsx | 3 - .../editor/esql_values_preview.tsx | 201 ++++++------------ 3 files changed, 144 insertions(+), 146 deletions(-) diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx index cc0a979bb52a8..e7cca77af8a28 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx @@ -7,7 +7,17 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { EuiFormRow, EuiSpacer } from '@elastic/eui'; +import { + EuiCode, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiIconTip, + EuiLoadingSpinner, + EuiPanel, + EuiSpacer, +} from '@elastic/eui'; +import { css } from '@emotion/react'; import React, { useCallback, useMemo, useState } from 'react'; import { appendStatsByToQuery, getIndexPatternFromESQLQuery } from '@kbn/esql-utils'; import type { AggregateQuery } from '@kbn/es-query'; @@ -25,6 +35,7 @@ import { getControlsTimezone } from '../../utils'; import { ESQLValuesPreview } from './esql_values_preview'; import type { DataControlEditorState } from './types'; import { getDataViewIdFromESQLQuery } from '../../utils/get_data_view_id_from_esql_query'; +import { DataControlEditorStrings } from '../data_control_constants'; interface ConfigureValuesQueryProps { editorState: Partial; @@ -147,6 +158,11 @@ export const ConfigureValuesQuery = ({ [editorState.esql_query] ); + const singleColumn = useMemo( + () => (previewColumns.length === 1 ? previewColumns[0] : null), + [previewColumns] + ); + const controlsContext = useMemo(() => { const supportsControls = apiCanAddNewPanel(parentApi) || apiCanPinPanels(parentApi); if (!supportsControls) return undefined; @@ -202,16 +218,64 @@ export const ConfigureValuesQuery = ({ /> - + {isPreviewQueryRunning ? ( + + + + ) : ( + <> + {singleColumn && ( + <> + + + + {dataSource} + + + + + {DataControlEditorStrings.manageControl.dataSource.valuesPreview.getFieldLabel()}{' '} + + + } + > + {singleColumn.name} + + + + + + )} + {!previewQueryNeedsRunning && ( + + + + )} + + )} ); }; diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.test.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.test.tsx index 6adf758d75f99..889b94a3fce00 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.test.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.test.tsx @@ -16,9 +16,6 @@ import { ESQLValuesPreview } from './esql_values_preview'; const noopProps = { updateQuery: jest.fn(), - isQueryRunning: false, - queryNeedsRunning: false, - dataSource: 'index', }; const numericColumn: ESQLColumn = { name: 'bytes', type: 'long' }; diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx index 161d27771fa6b..e3528d93682b4 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx @@ -8,21 +8,12 @@ */ import React, { useMemo } from 'react'; -import { css } from '@emotion/react'; import { EuiBadge, EuiBadgeGroup, EuiCallOut, - EuiCode, EuiFlexGrid, - EuiFormRow, - EuiPanel, - EuiSpacer, EuiStat, - EuiFlexGroup, - EuiFlexItem, - EuiLoadingSpinner, - EuiIconTip, } from '@elastic/eui'; import { max, min } from 'lodash'; import type { ESQLColumn } from '@kbn/es-types'; @@ -38,20 +29,8 @@ export const ESQLValuesPreview: React.FC<{ previewColumns: ESQLColumn[]; previewError?: Error; updateQuery: (column: string) => void; - queryNeedsRunning: boolean; - isQueryRunning: boolean; - dataSource: string; selectedControlType?: DataControlType; -}> = ({ - previewOptions, - previewError, - previewColumns, - updateQuery, - queryNeedsRunning, - isQueryRunning, - dataSource, - selectedControlType, -}) => { +}> = ({ previewOptions, previewError, previewColumns, updateQuery, selectedControlType }) => { const isEmpty = useMemo(() => previewOptions.length === 0, [previewOptions]); const multiColumnResult = useMemo(() => previewColumns.length > 1, [previewColumns]); @@ -68,63 +47,74 @@ export const ESQLValuesPreview: React.FC<{ return null; }, [previewOptions, selectedControlType, singleColumn]); - const body = previewError ? ( - -

{previewError.message}

-
- ) : multiColumnResult ? ( - -

- {DataControlEditorStrings.manageControl.dataSource.valuesPreview.getMultiColumnErrorBody( - previewColumns.length - )} -

- -
- ) : isEmpty ? ( - -

{DataControlEditorStrings.manageControl.dataSource.valuesPreview.getEmptyText()}

-
- ) : range ? ( - - - - - ) : ( -
+ if (previewError) { + return ( + +

{previewError.message}

+
+ ); + } + + if (multiColumnResult) { + return ( + +

+ {DataControlEditorStrings.manageControl.dataSource.valuesPreview.getMultiColumnErrorBody( + previewColumns.length + )} +

+ +
+ ); + } + + if (isEmpty) { + return ( + +

{DataControlEditorStrings.manageControl.dataSource.valuesPreview.getEmptyText()}

+
+ ); + } + + if (range) { + return ( + + + + + ); + } + + return ( +
{previewOptions.map((option, i) => ( {option === '' ? EMPTY_LABEL : option} @@ -132,57 +122,4 @@ export const ESQLValuesPreview: React.FC<{
); - - return isQueryRunning ? ( - - - - ) : ( - <> - {singleColumn && ( - <> - - - - {dataSource} - - - - - {DataControlEditorStrings.manageControl.dataSource.valuesPreview.getFieldLabel()}{' '} - - - } - > - {singleColumn.name} - - - - - - )} - {!queryNeedsRunning && ( - - {body} - - )} - - ); }; From 8b82b8f4951cb61c0af5cfd99c5edd33fb0d6d14 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 14:01:48 -0600 Subject: [PATCH 04/21] move to package --- .../packages/shared/kbn-esql-utils/index.ts | 1 + .../shared/kbn-esql-utils/src/index.ts | 2 + .../controls}/choose_column_popover.test.tsx | 0 .../utils/controls}/choose_column_popover.tsx | 47 +++++++++---------- .../controls}/esql_values_preview.test.tsx | 1 + .../utils/controls}/esql_values_preview.tsx | 44 ++++++++++------- .../shared/kbn-esql-utils/tsconfig.json | 3 ++ .../editor/configure_values_query.tsx | 2 +- 8 files changed, 56 insertions(+), 44 deletions(-) rename src/platform/{plugins/shared/controls/public/controls/data_controls/editor => packages/shared/kbn-esql-utils/src/utils/controls}/choose_column_popover.test.tsx (100%) rename src/platform/{plugins/shared/controls/public/controls/data_controls/editor => packages/shared/kbn-esql-utils/src/utils/controls}/choose_column_popover.tsx (69%) rename src/platform/{plugins/shared/controls/public/controls/data_controls/editor => packages/shared/kbn-esql-utils/src/utils/controls}/esql_values_preview.test.tsx (99%) rename src/platform/{plugins/shared/controls/public/controls/data_controls/editor => packages/shared/kbn-esql-utils/src/utils/controls}/esql_values_preview.tsx (71%) diff --git a/src/platform/packages/shared/kbn-esql-utils/index.ts b/src/platform/packages/shared/kbn-esql-utils/index.ts index 11ab5d427e874..e9ea6024b7e2b 100644 --- a/src/platform/packages/shared/kbn-esql-utils/index.ts +++ b/src/platform/packages/shared/kbn-esql-utils/index.ts @@ -102,6 +102,7 @@ export { isSingleSource, type ESQLSourceKind, ensureApproximationLicense, + ESQLValuesPreview, } from './src'; export { ENABLE_ESQL, GROUP_NOT_SET_VALUE } from './constants'; diff --git a/src/platform/packages/shared/kbn-esql-utils/src/index.ts b/src/platform/packages/shared/kbn-esql-utils/src/index.ts index b42c7eece7eed..7dd92446c3b29 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/index.ts +++ b/src/platform/packages/shared/kbn-esql-utils/src/index.ts @@ -110,3 +110,5 @@ export { injectWhereClauseAfterSourceCommand } from './utils/inject_where_after_ export * from './utils/callbacks'; export { ensureApproximationLicense } from './utils/ensure_approximation_license'; + +export { ESQLValuesPreview } from './utils/controls/esql_values_preview'; diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/choose_column_popover.test.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/choose_column_popover.test.tsx similarity index 100% rename from src/platform/plugins/shared/controls/public/controls/data_controls/editor/choose_column_popover.test.tsx rename to src/platform/packages/shared/kbn-esql-utils/src/utils/controls/choose_column_popover.test.tsx diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/choose_column_popover.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/choose_column_popover.tsx similarity index 69% rename from src/platform/plugins/shared/controls/public/controls/data_controls/editor/choose_column_popover.tsx rename to src/platform/packages/shared/kbn-esql-utils/src/utils/controls/choose_column_popover.tsx index 304283f558291..ed7d083f536ba 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/choose_column_popover.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/choose_column_popover.tsx @@ -10,9 +10,8 @@ import React, { useCallback, useState } from 'react'; import type { EuiSelectableOption } from '@elastic/eui'; import { EuiButtonEmpty, EuiPopover, EuiSelectable } from '@elastic/eui'; -import { css } from '@emotion/react'; import type { ESQLColumn } from '@kbn/es-types'; -import { DataControlEditorStrings } from '../data_control_constants'; +import { i18n } from '@kbn/i18n'; export function ChooseColumnPopover({ columns, @@ -26,25 +25,13 @@ export function ChooseColumnPopover({ columns.map((column) => ({ label: column.name })) ); - const onButtonClick = () => setIsPopoverOpen((status) => !status); - const closePopover = () => setIsPopoverOpen(false); - - const button = ( - - {DataControlEditorStrings.manageControl.dataSource.valuesPreview.getSelectAColumnText()} - - ); + const selectAColumnText = i18n.translate('esqlUtils.valuesPreview.selectAColumnText', { + defaultMessage: 'Select a column', + }); const onColumnChange = useCallback( (newOptions: EuiSelectableOption[]) => { setOptions(newOptions); - const selectedColumn = newOptions.find((option) => option.checked === 'on'); if (selectedColumn) { updateQuery(selectedColumn.label); @@ -53,22 +40,30 @@ export function ChooseColumnPopover({ [updateQuery] ); + const button = ( + setIsPopoverOpen((status) => !status)} + data-test-subj="chooseColumnBtn" + > + {selectAColumnText} + + ); + return ( setIsPopoverOpen(false)} > { expect(queryByTestId('esqlValuesPreviewRange')).not.toBeInTheDocument(); expect(getByTestId('esqlValuesPreviewStrings')).toBeInTheDocument(); }); + it('renders a list of values for string columns', () => { const { getByTestId } = render( diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx similarity index 71% rename from src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx rename to src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx index e3528d93682b4..d162cf14c567f 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/esql_values_preview.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx @@ -8,21 +8,15 @@ */ import React, { useMemo } from 'react'; -import { - EuiBadge, - EuiBadgeGroup, - EuiCallOut, - EuiFlexGrid, - EuiStat, -} from '@elastic/eui'; +import { EuiBadge, EuiBadgeGroup, EuiCallOut, EuiFlexGrid, EuiStat } from '@elastic/eui'; import { max, min } from 'lodash'; import type { ESQLColumn } from '@kbn/es-types'; import { isNumericType } from '@kbn/esql-language'; import { EMPTY_LABEL } from '@kbn/field-formats-common'; +import { i18n } from '@kbn/i18n'; import { RANGE_SLIDER_CONTROL } from '@kbn/controls-constants'; import type { DataControlType } from '@kbn/controls-constants'; import { ChooseColumnPopover } from './choose_column_popover'; -import { DataControlEditorStrings } from '../data_control_constants'; export const ESQLValuesPreview: React.FC<{ previewOptions: string[] | number[]; @@ -51,7 +45,9 @@ export const ESQLValuesPreview: React.FC<{ return (

- {DataControlEditorStrings.manageControl.dataSource.valuesPreview.getMultiColumnErrorBody( - previewColumns.length - )} + {i18n.translate('esqlUtils.valuesPreview.multiColumnErrorBody', { + defaultMessage: + 'Your query is currently returning {totalColumns} columns. Choose a column, or use STATS BY to narrow your query down.', + values: { totalColumns: previewColumns.length }, + })}

@@ -85,13 +85,19 @@ export const ESQLValuesPreview: React.FC<{ return ( -

{DataControlEditorStrings.manageControl.dataSource.valuesPreview.getEmptyText()}

+

+ {i18n.translate('esqlUtils.valuesPreview.emptyText', { + defaultMessage: "This query isn't returning any values. Edit it and run it again.", + })} +

); } @@ -102,12 +108,16 @@ export const ESQLValuesPreview: React.FC<{ ); diff --git a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json index f5cb80f044b82..3d9dec38ef341 100644 --- a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json +++ b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json @@ -16,6 +16,7 @@ "target/**/*" ], "kbn_references": [ + "@elastic/eui", "@kbn/data-views-plugin", "@kbn/crypto-browser", "@kbn/data-view-utils", @@ -23,9 +24,11 @@ "@kbn/esql-types", "@kbn/search-types", "@kbn/expressions-plugin", + "@kbn/field-formats-common", "@kbn/field-types", "@kbn/es-types", "@kbn/i18n", + "@kbn/i18n-react", "@kbn/datemath", "@kbn/es-query", "@kbn/code-editor", diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx index e7cca77af8a28..8209ee5ab29ee 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx @@ -29,10 +29,10 @@ import type { ESQLControlVariable } from '@kbn/esql-types'; import { apiCanAddNewPanel, apiCanPinPanels } from '@kbn/presentation-publishing'; import { DEFAULT_ESQL_OPTIONS_LIST_STATE, ESQL_CONTROL } from '@kbn/controls-constants'; import type { DataControlType } from '@kbn/controls-constants'; +import { ESQLValuesPreview } from '@kbn/esql-utils'; import { dataService } from '../../../services/kibana_services'; import { getESQLSingleColumnValues } from '../../../../common/options_list'; import { getControlsTimezone } from '../../utils'; -import { ESQLValuesPreview } from './esql_values_preview'; import type { DataControlEditorState } from './types'; import { getDataViewIdFromESQLQuery } from '../../utils/get_data_view_id_from_esql_query'; import { DataControlEditorStrings } from '../data_control_constants'; From daaa9a5b3833e0682ed7c962f9fa1f7f1096b888 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 14:16:37 -0600 Subject: [PATCH 05/21] replace variable preview values with shared component --- .../utils/controls/esql_values_preview.tsx | 2 +- .../value_control_form.test.tsx | 2 +- .../control_flyout/value_control_form.tsx | 81 +++---------------- .../plugins/shared/esql/tsconfig.json | 1 + 4 files changed, 15 insertions(+), 71 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx index d162cf14c567f..4ecbd52ebee78 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx @@ -91,7 +91,7 @@ export const ESQLValuesPreview: React.FC<{ color="warning" iconType="warning" size="s" - data-test-subj="esqlMoreThanOneColumnCallout" + data-test-subj="esqlNoValuesForControlCallout" >

{i18n.translate('esqlUtils.valuesPreview.emptyText', { diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx index 33c34f696d0bd..889234ca90a99 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx @@ -249,7 +249,7 @@ describe('ValueControlForm', () => { ); // values preview panel should be rendered - expect(await findByTestId('esqlValuesPreview')).toBeInTheDocument(); + expect(await findByTestId('esqlValuesPreviewStrings')).toBeInTheDocument(); }); it('should be able to change in fields type', async () => { diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx index b586bdcdb8ed7..d6a22a2344483 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx @@ -8,16 +8,9 @@ */ import type { EuiComboBoxOptionOption } from '@elastic/eui'; -import { - EuiCallOut, - EuiComboBox, - EuiFormLabel, - EuiFormRow, - EuiPanel, - EuiSpacer, - useEuiTheme, -} from '@elastic/eui'; +import { EuiComboBox, EuiFormLabel, EuiFormRow, EuiSpacer, useEuiTheme } from '@elastic/eui'; import { css } from '@emotion/react'; +import type { ESQLColumn } from '@kbn/es-types'; import type { TimeRange } from '@kbn/es-query'; import { ESQLVariableType, @@ -30,11 +23,11 @@ import { import type { OptionsListESQLControlState } from '@kbn/controls-schemas'; import { appendStatsByToQuery, + ESQLValuesPreview, getESQLResults, getIndexPatternFromESQLQuery, } from '@kbn/esql-utils'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import type { ISearchGeneric } from '@kbn/search-types'; import { isEqual } from 'lodash'; @@ -44,7 +37,6 @@ import { UI_SETTINGS } from '@kbn/data-plugin/public'; import { reportEsqlError } from '@kbn/esql-editor'; import { ESQLLangEditor } from '../../../create_editor'; import type { ServiceDeps } from '../../../kibana_services'; -import { ChooseColumnPopover } from './choose_column_popover'; import { ControlLabel, ControlSelectionType } from './shared_form_components'; interface ValueControlFormProps { @@ -126,8 +118,8 @@ export function ValueControlForm({ : '' ); const [esqlQueryErrors, setEsqlQueryErrors] = useState(); - const [queryColumns, setQueryColumns] = useState( - valuesRetrieval ? [valuesRetrieval] : [] + const [queryColumns, setQueryColumns] = useState( + valuesRetrieval ? [{ name: valuesRetrieval, type: 'keyword' as const }] : [] ); const [showValuesPreview, setShowValuesPreview] = useState(false); const [label, setLabel] = useState(initialState?.title ?? ''); @@ -197,7 +189,7 @@ export function ValueControlForm({ if (!isMounted() || controller.signal.aborted) { return; } - const columns = results.response.columns.map((col) => col.name); + const columns = results.response.columns; setQueryColumns(columns); setShowValuesPreview(true); @@ -352,61 +344,12 @@ export function ValueControlForm({ margin-block-start: ${theme.euiTheme.size.base}; `} > - <> - {queryColumns.length === 0 && ( - - )} - {queryColumns.length === 1 && ( - - {selectedValues.map((value) => value.label).join(', ')} - - )} - {queryColumns.length > 1 && ( - -

- STATS BY, - chooseColumnPopover: ( - - ), - }} - /> -

- - )} - + v.label)} + previewColumns={queryColumns} + previewError={esqlQueryErrors?.[0]} + updateQuery={updateQuery} + /> )} diff --git a/src/platform/plugins/shared/esql/tsconfig.json b/src/platform/plugins/shared/esql/tsconfig.json index f4c8b56284354..e46a8cefe23b0 100644 --- a/src/platform/plugins/shared/esql/tsconfig.json +++ b/src/platform/plugins/shared/esql/tsconfig.json @@ -55,6 +55,7 @@ "@kbn/management-settings-ids", "@kbn/core-ui-settings-server", "@kbn/es-errors", + "@kbn/es-types", ], "exclude": [ "target/**/*", From 95ce46a4840caa92de7851465e9aafdf2e609c05 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 15:10:23 -0600 Subject: [PATCH 06/21] only render first 10 values --- .../src/utils/controls/esql_values_preview.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx index 4ecbd52ebee78..673446b2076fa 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx @@ -123,13 +123,24 @@ export const ESQLValuesPreview: React.FC<{ ); } + const visibleOptions = previewOptions.slice(0, 10); + const hiddenCount = previewOptions.length - visibleOptions.length; + return ( -
+
- {previewOptions.map((option, i) => ( + {visibleOptions.map((option, i) => ( {option === '' ? EMPTY_LABEL : option} ))} + {hiddenCount > 0 && ( +

+ {i18n.translate('esqlUtils.valuesPreview.hiddenCount', { + defaultMessage: '+{hiddenCount} more', + values: { hiddenCount }, + })} +

+ )}
); }; From e240bff7896b5aa15ca0555552c6e419102d9964 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 11 Sep 2026 21:20:20 +0000 Subject: [PATCH 07/21] Changes from node scripts/check --- src/platform/packages/shared/kbn-esql-utils/moon.yml | 2 ++ .../packages/shared/kbn-esql-utils/tsconfig.json | 1 - src/platform/plugins/shared/controls/moon.yml | 1 - .../data_controls/editor/data_control_editor.tsx | 11 ++--------- src/platform/plugins/shared/controls/tsconfig.json | 1 - src/platform/plugins/shared/esql/moon.yml | 1 + 6 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/moon.yml b/src/platform/packages/shared/kbn-esql-utils/moon.yml index cd96fa931848a..0f73f9110f0c3 100644 --- a/src/platform/packages/shared/kbn-esql-utils/moon.yml +++ b/src/platform/packages/shared/kbn-esql-utils/moon.yml @@ -24,9 +24,11 @@ dependsOn: - '@kbn/esql-types' - '@kbn/search-types' - '@kbn/expressions-plugin' + - '@kbn/field-formats-common' - '@kbn/field-types' - '@kbn/es-types' - '@kbn/i18n' + - '@kbn/i18n-react' - '@kbn/datemath' - '@kbn/es-query' - '@kbn/code-editor' diff --git a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json index 3d9dec38ef341..e3e9b3b98aeff 100644 --- a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json +++ b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json @@ -16,7 +16,6 @@ "target/**/*" ], "kbn_references": [ - "@elastic/eui", "@kbn/data-views-plugin", "@kbn/crypto-browser", "@kbn/data-view-utils", diff --git a/src/platform/plugins/shared/controls/moon.yml b/src/platform/plugins/shared/controls/moon.yml index 6c5c0d818aae1..f668aef64d077 100644 --- a/src/platform/plugins/shared/controls/moon.yml +++ b/src/platform/plugins/shared/controls/moon.yml @@ -49,7 +49,6 @@ dependsOn: - '@kbn/esql' - '@kbn/presentation-publishing-schemas' - '@kbn/controls-renderer' - - '@kbn/field-formats-common' - '@kbn/ui-callout' tags: - plugin diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx index 556141b446eb7..1473393a91a57 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx @@ -163,11 +163,7 @@ const CompatibleControlTypesComponent = ({ data-test-subj={`create__${action.type}`} isSelected={action.type === selectedAction} disabled={disabled} - onClick={() => - setSelectedAction( - action.type as DataControlType - ) - } + onClick={() => setSelectedAction(action.type as DataControlType)} label={action.getDisplayName(controlTypeContext)} > Date: Fri, 11 Sep 2026 15:49:34 -0600 Subject: [PATCH 08/21] fix test --- .../control_flyout/value_control_form.test.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx index 889234ca90a99..3777b5c2e0ccc 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.test.tsx @@ -34,10 +34,7 @@ jest.mock('@kbn/esql-utils', () => { columns: [ { name: 'field', - id: 'field', - meta: { - type: 'keyword', - }, + type: 'keyword', }, ], values: [['v1'], ['v2']], @@ -48,6 +45,8 @@ jest.mock('@kbn/esql-utils', () => { getValuesFromQueryField: jest.fn().mockReturnValue('field'), getESQLQueryColumnsRaw: jest.fn().mockResolvedValue([{ name: 'column1' }, { name: 'column2' }]), getVariableNamePrefix: actual.getVariableNamePrefix, + ESQLValuesPreview: actual.ESQLValuesPreview, + appendStatsByToQuery: actual.appendStatsByToQuery, }; }); From 14c34af388b8c05bf85fd07c56e96a2394bbbb10 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 16:14:23 -0600 Subject: [PATCH 09/21] migrate translations --- .../utils/controls/choose_column_popover.tsx | 12 ++-- .../utils/controls/esql_values_preview.tsx | 18 ++--- .../data_controls/data_control_constants.tsx | 71 ------------------- .../translations/translations/de-DE.json | 14 ++-- .../translations/translations/fr-FR.json | 14 ++-- .../translations/translations/ja-JP.json | 14 ++-- .../translations/translations/zh-CN.json | 14 ++-- 7 files changed, 44 insertions(+), 113 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/choose_column_popover.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/choose_column_popover.tsx index ed7d083f536ba..3cc594bc9f122 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/choose_column_popover.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/choose_column_popover.tsx @@ -13,6 +13,10 @@ import { EuiButtonEmpty, EuiPopover, EuiSelectable } from '@elastic/eui'; import type { ESQLColumn } from '@kbn/es-types'; import { i18n } from '@kbn/i18n'; +const SELECT_COLUMN_LABEL = i18n.translate('esqlUtils.valuesPreview.selectAColumnText', { + defaultMessage: 'Select a column', +}); + export function ChooseColumnPopover({ columns, updateQuery, @@ -25,10 +29,6 @@ export function ChooseColumnPopover({ columns.map((column) => ({ label: column.name })) ); - const selectAColumnText = i18n.translate('esqlUtils.valuesPreview.selectAColumnText', { - defaultMessage: 'Select a column', - }); - const onColumnChange = useCallback( (newOptions: EuiSelectableOption[]) => { setOptions(newOptions); @@ -46,7 +46,7 @@ export function ChooseColumnPopover({ onClick={() => setIsPopoverOpen((status) => !status)} data-test-subj="chooseColumnBtn" > - {selectAColumnText} + {SELECT_COLUMN_LABEL} ); @@ -60,7 +60,7 @@ export function ChooseColumnPopover({ closePopover={() => setIsPopoverOpen(false)} > -

- {i18n.translate('esqlUtils.valuesPreview.multiColumnErrorBody', { - defaultMessage: - 'Your query is currently returning {totalColumns} columns. Choose a column, or use STATS BY to narrow your query down.', - values: { totalColumns: previewColumns.length }, - })} -

+ STATS BY, + }} + /> ); diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/data_control_constants.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/data_control_constants.tsx index e87a7cd914ece..688f4f6a4b449 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/data_control_constants.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/data_control_constants.tsx @@ -133,38 +133,6 @@ export const DataControlEditorStrings = { i18n.translate('controls.controlGroup.manageControl.dataSource.valuesPreview.title', { defaultMessage: 'Values preview', }), - getRunQueryButton: () => - i18n.translate( - 'controls.controlGroup.manageControl.dataSource.valuesPreview.runQueryButton', - { - defaultMessage: 'Run query', - } - ), - getEmptyTitle: () => - i18n.translate( - 'controls.controlGroup.manageControl.dataSource.valuesPreview.emptyTitle', - { - defaultMessage: 'No values returned', - } - ), - getEmptyText: () => - i18n.translate('controls.controlGroup.manageControl.dataSource.valuesPreview.emptyText', { - defaultMessage: "This query isn't returning any values. Edit it and run it again.", - }), - getQueryNeedsRunningText: () => - i18n.translate( - 'controls.controlGroup.manageControl.dataSource.valuesPreview.queryNeedsRunningText', - { - defaultMessage: 'Run the query to get a preview of possible values.', - } - ), - getErrorTitle: () => - i18n.translate( - 'controls.controlGroup.manageControl.dataSource.valuesPreview.errorTitle', - { - defaultMessage: 'Error getting values preview', - } - ), getDataSourceLabel: () => i18n.translate( 'controls.controlGroup.manageControl.dataSource.valuesPreview.dataSourceLabel', @@ -189,45 +157,6 @@ export const DataControlEditorStrings = { }} /> ), - getMultiColumnErrorTitle: () => - i18n.translate( - 'controls.controlGroup.manageControl.dataSource.valuesPreview.multiColumnErrorTitle', - { - defaultMessage: 'Query must return a single column', - } - ), - getMultiColumnErrorBody: (totalColumns: number) => ( - STATS BY, - }} - /> - ), - getColumnsListLabel: () => - i18n.translate( - 'controls.controlGroup.manageControl.dataSource.valuesPreview.columnsListLabel', - { - defaultMessage: 'Columns', - } - ), - getSelectAColumnText: () => - i18n.translate( - 'controls.controlGroup.manageControl.dataSource.valuesPreview.selectAColumnText', - { - defaultMessage: 'Select a column', - } - ), - getMinText: () => - i18n.translate('controls.controlGroup.manageControl.dataSource.valuesPreview.minText', { - defaultMessage: 'Minimum value', - }), - getMaxText: () => - i18n.translate('controls.controlGroup.manageControl.dataSource.valuesPreview.maxText', { - defaultMessage: 'Maximum value', - }), }, }, displaySettings: { diff --git a/x-pack/platform/plugins/private/translations/translations/de-DE.json b/x-pack/platform/plugins/private/translations/translations/de-DE.json index d0feda605fb95..aeb913f5f6de1 100644 --- a/x-pack/platform/plugins/private/translations/translations/de-DE.json +++ b/x-pack/platform/plugins/private/translations/translations/de-DE.json @@ -984,15 +984,15 @@ "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "Bitte wählen Sie eine Datenquelle", "controls.controlGroup.manageControl.dataSource.valuesPreview.columnsListLabel": "Spalten", "controls.controlGroup.manageControl.dataSource.valuesPreview.dataSourceLabel": "Datenquelle", - "controls.controlGroup.manageControl.dataSource.valuesPreview.emptyText": "Diese Abfrage liefert keine Werte. Bearbeiten Sie sie und führen Sie sie erneut aus.", - "controls.controlGroup.manageControl.dataSource.valuesPreview.emptyTitle": "Keine Werte", - "controls.controlGroup.manageControl.dataSource.valuesPreview.errorTitle": "Fehler beim Abrufen der Wertevorschau", + "esqlUtils.valuesPreview.emptyText": "Diese Abfrage liefert keine Werte. Bearbeiten Sie sie und führen Sie sie erneut aus.", + "esqlUtils.valuesPreview.emptyTitle": "Keine Werte", + "esqlUtils.valuesPreview.errorTitle": "Fehler beim Abrufen der Wertevorschau", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldLabel": "Feld", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldTooltipText": "Das Feld, auf dem die Steuerung und die angebotenen Optionen basieren. Dieses Feld wird durch die anhand Ihrer Abfrage erstellte Spalte bestimmt, zum Beispiel durch Verwendung von {statsBy}- oder {rename}-Befehlen.", - "controls.controlGroup.manageControl.dataSource.valuesPreview.maxText": "Maximalwert", - "controls.controlGroup.manageControl.dataSource.valuesPreview.minText": "Mindestwert", - "controls.controlGroup.manageControl.dataSource.valuesPreview.multiColumnErrorBody": "Ihre Abfrage ergibt derzeit {totalColumns} Spalten. Wählen Sie eine Spalte oder verwenden Sie {statsBy}, um Ihre Anfrage einzugrenzen.", - "controls.controlGroup.manageControl.dataSource.valuesPreview.multiColumnErrorTitle": "Die Abfrage muss eine einzelne Spalte zurückgeben", + "esqlUtils.valuesPreview.maxText": "Maximalwert", + "esqlUtils.valuesPreview.minText": "Mindestwert", + "esqlUtils.valuesPreview.multiColumnErrorBody": "Ihre Abfrage ergibt derzeit {totalColumns} Spalten. Wählen Sie eine Spalte oder verwenden Sie {statsBy}, um Ihre Anfrage einzugrenzen.", + "esqlUtils.valuesPreview.multiColumnErrorTitle": "Die Abfrage muss eine einzelne Spalte zurückgeben", "controls.controlGroup.manageControl.dataSource.valuesPreview.queryNeedsRunningText": "Führen Sie die Abfrage aus, um eine Vorschau der möglichen Werte zu erhalten.", "controls.controlGroup.manageControl.dataSource.valuesPreview.runQueryButton": "Abfrage ausführen", "controls.controlGroup.manageControl.dataSource.valuesPreview.selectAColumnText": "Wählen Sie eine Spalte aus", diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index 2b31a1498b5b2..0372e261930dd 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -982,15 +982,15 @@ "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "Veuillez sélectionner une vue de données", "controls.controlGroup.manageControl.dataSource.valuesPreview.columnsListLabel": "Colonnes", "controls.controlGroup.manageControl.dataSource.valuesPreview.dataSourceLabel": "Source de données", - "controls.controlGroup.manageControl.dataSource.valuesPreview.emptyText": "Cette requête ne renvoie aucune valeur. Modifiez-la et exécutez-la à nouveau.", - "controls.controlGroup.manageControl.dataSource.valuesPreview.emptyTitle": "Aucune valeur renvoyée", - "controls.controlGroup.manageControl.dataSource.valuesPreview.errorTitle": "Erreur lors de l'obtention de l'aperçu des valeurs", + "esqlUtils.valuesPreview.emptyText": "Cette requête ne renvoie aucune valeur. Modifiez-la et exécutez-la à nouveau.", + "esqlUtils.valuesPreview.emptyTitle": "Aucune valeur renvoyée", + "esqlUtils.valuesPreview.errorTitle": "Erreur lors de l'obtention de l'aperçu des valeurs", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldLabel": "Champ", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldTooltipText": "Le champ sur lequel se baseront le contrôle et les options qu'il propose. Ce champ est déterminé par la colonne renvoyée par votre requête, par exemple en utilisant les commandes {statsBy} ou {rename}.", - "controls.controlGroup.manageControl.dataSource.valuesPreview.maxText": "Valeur maximale", - "controls.controlGroup.manageControl.dataSource.valuesPreview.minText": "Valeur minimale", - "controls.controlGroup.manageControl.dataSource.valuesPreview.multiColumnErrorBody": "Votre requête renvoie actuellement {totalColumns} colonnes. Choisissez une colonne, ou utilisez {statsBy} pour affiner votre requête.", - "controls.controlGroup.manageControl.dataSource.valuesPreview.multiColumnErrorTitle": "La requête doit renvoyer une seule colonne", + "esqlUtils.valuesPreview.maxText": "Valeur maximale", + "esqlUtils.valuesPreview.minText": "Valeur minimale", + "esqlUtils.valuesPreview.multiColumnErrorBody": "Votre requête renvoie actuellement {totalColumns} colonnes. Choisissez une colonne, ou utilisez {statsBy} pour affiner votre requête.", + "esqlUtils.valuesPreview.multiColumnErrorTitle": "La requête doit renvoyer une seule colonne", "controls.controlGroup.manageControl.dataSource.valuesPreview.queryNeedsRunningText": "Exécutez la requête pour obtenir un aperçu des valeurs possibles.", "controls.controlGroup.manageControl.dataSource.valuesPreview.runQueryButton": "Exécuter la requête", "controls.controlGroup.manageControl.dataSource.valuesPreview.selectAColumnText": "Sélectionner une colonne", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index 142fb8de35d23..c69edd42cfb73 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -984,15 +984,15 @@ "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "データビューを選択してください", "controls.controlGroup.manageControl.dataSource.valuesPreview.columnsListLabel": "列", "controls.controlGroup.manageControl.dataSource.valuesPreview.dataSourceLabel": "データソース", - "controls.controlGroup.manageControl.dataSource.valuesPreview.emptyText": "このクエリは値を返していません。編集して、再度実行してください。", - "controls.controlGroup.manageControl.dataSource.valuesPreview.emptyTitle": "値は返されませんでした", - "controls.controlGroup.manageControl.dataSource.valuesPreview.errorTitle": "値のプレビューの取得中にエラーが発生しました", + "esqlUtils.valuesPreview.emptyText": "このクエリは値を返していません。編集して、再度実行してください。", + "esqlUtils.valuesPreview.emptyTitle": "値は返されませんでした", + "esqlUtils.valuesPreview.errorTitle": "値のプレビューの取得中にエラーが発生しました", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldLabel": "フィールド", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldTooltipText": "コントロールおよびそのオプションの基となるフィールド。このフィールドは、クエリによって返される列によって決定されます。たとえば、{statsBy}または{rename}コマンドを使用します。", - "controls.controlGroup.manageControl.dataSource.valuesPreview.maxText": "最高値", - "controls.controlGroup.manageControl.dataSource.valuesPreview.minText": "最小値", - "controls.controlGroup.manageControl.dataSource.valuesPreview.multiColumnErrorBody": "クエリは現在{totalColumns}列を返しています。列を選択するか、{statsBy}を使ってクエリを絞り込んでください。", - "controls.controlGroup.manageControl.dataSource.valuesPreview.multiColumnErrorTitle": "クエリは1列を返す必要があります", + "esqlUtils.valuesPreview.maxText": "最高値", + "esqlUtils.valuesPreview.minText": "最小値", + "esqlUtils.valuesPreview.multiColumnErrorBody": "クエリは現在{totalColumns}列を返しています。列を選択するか、{statsBy}を使ってクエリを絞り込んでください。", + "esqlUtils.valuesPreview.multiColumnErrorTitle": "クエリは1列を返す必要があります", "controls.controlGroup.manageControl.dataSource.valuesPreview.queryNeedsRunningText": "クエリを実行して可能な値のプレビューを取得します。", "controls.controlGroup.manageControl.dataSource.valuesPreview.runQueryButton": "クエリを実行", "controls.controlGroup.manageControl.dataSource.valuesPreview.selectAColumnText": "列を選択", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index 86e92f519ab73..dde37db034e9f 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -984,15 +984,15 @@ "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "请选择数据视图", "controls.controlGroup.manageControl.dataSource.valuesPreview.columnsListLabel": "列", "controls.controlGroup.manageControl.dataSource.valuesPreview.dataSourceLabel": "数据源", - "controls.controlGroup.manageControl.dataSource.valuesPreview.emptyText": "此查询未返回任何值。请编辑后再次运行。", - "controls.controlGroup.manageControl.dataSource.valuesPreview.emptyTitle": "没有值返回", - "controls.controlGroup.manageControl.dataSource.valuesPreview.errorTitle": "获取值预览时出错", + "esqlUtils.valuesPreview.emptyText": "此查询未返回任何值。请编辑后再次运行。", + "esqlUtils.valuesPreview.emptyTitle": "没有值返回", + "esqlUtils.valuesPreview.errorTitle": "获取值预览时出错", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldLabel": "字段", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldTooltipText": "该控件及其提供的选项将基于该字段。此字段由您的查询返回的列确定,例如使用 {statsBy} 或 {rename} 命令。", - "controls.controlGroup.manageControl.dataSource.valuesPreview.maxText": "最大值", - "controls.controlGroup.manageControl.dataSource.valuesPreview.minText": "最小值", - "controls.controlGroup.manageControl.dataSource.valuesPreview.multiColumnErrorBody": "您的查询当前正返回 {totalColumns} 列。选择一列,或使用 {statsBy} 缩小查询范围。", - "controls.controlGroup.manageControl.dataSource.valuesPreview.multiColumnErrorTitle": "查询必须返回单列", + "esqlUtils.valuesPreview.maxText": "最大值", + "esqlUtils.valuesPreview.minText": "最小值", + "esqlUtils.valuesPreview.multiColumnErrorBody": "您的查询当前正返回 {totalColumns} 列。选择一列,或使用 {statsBy} 缩小查询范围。", + "esqlUtils.valuesPreview.multiColumnErrorTitle": "查询必须返回单列", "controls.controlGroup.manageControl.dataSource.valuesPreview.queryNeedsRunningText": "运行查询以预览可能的值。", "controls.controlGroup.manageControl.dataSource.valuesPreview.runQueryButton": "运行查询", "controls.controlGroup.manageControl.dataSource.valuesPreview.selectAColumnText": "选择列", From 2c3544b6f8cba44bf31ff2bb4b157f8c0ea061d7 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 16:16:00 -0600 Subject: [PATCH 10/21] i18n --- .../translations/translations/de-DE.json | 21 +++++++------------ .../translations/translations/fr-FR.json | 21 +++++++------------ .../translations/translations/ja-JP.json | 21 +++++++------------ .../translations/translations/zh-CN.json | 21 +++++++------------ 4 files changed, 28 insertions(+), 56 deletions(-) diff --git a/x-pack/platform/plugins/private/translations/translations/de-DE.json b/x-pack/platform/plugins/private/translations/translations/de-DE.json index aeb913f5f6de1..7bc0753c402eb 100644 --- a/x-pack/platform/plugins/private/translations/translations/de-DE.json +++ b/x-pack/platform/plugins/private/translations/translations/de-DE.json @@ -982,20 +982,9 @@ "controls.controlGroup.manageControl.dataSource.fieldListErrorTitle": "Fehler beim Laden der Feldliste", "controls.controlGroup.manageControl.dataSource.fieldTitle": "Feld", "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "Bitte wählen Sie eine Datenquelle", - "controls.controlGroup.manageControl.dataSource.valuesPreview.columnsListLabel": "Spalten", "controls.controlGroup.manageControl.dataSource.valuesPreview.dataSourceLabel": "Datenquelle", - "esqlUtils.valuesPreview.emptyText": "Diese Abfrage liefert keine Werte. Bearbeiten Sie sie und führen Sie sie erneut aus.", - "esqlUtils.valuesPreview.emptyTitle": "Keine Werte", - "esqlUtils.valuesPreview.errorTitle": "Fehler beim Abrufen der Wertevorschau", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldLabel": "Feld", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldTooltipText": "Das Feld, auf dem die Steuerung und die angebotenen Optionen basieren. Dieses Feld wird durch die anhand Ihrer Abfrage erstellte Spalte bestimmt, zum Beispiel durch Verwendung von {statsBy}- oder {rename}-Befehlen.", - "esqlUtils.valuesPreview.maxText": "Maximalwert", - "esqlUtils.valuesPreview.minText": "Mindestwert", - "esqlUtils.valuesPreview.multiColumnErrorBody": "Ihre Abfrage ergibt derzeit {totalColumns} Spalten. Wählen Sie eine Spalte oder verwenden Sie {statsBy}, um Ihre Anfrage einzugrenzen.", - "esqlUtils.valuesPreview.multiColumnErrorTitle": "Die Abfrage muss eine einzelne Spalte zurückgeben", - "controls.controlGroup.manageControl.dataSource.valuesPreview.queryNeedsRunningText": "Führen Sie die Abfrage aus, um eine Vorschau der möglichen Werte zu erhalten.", - "controls.controlGroup.manageControl.dataSource.valuesPreview.runQueryButton": "Abfrage ausführen", - "controls.controlGroup.manageControl.dataSource.valuesPreview.selectAColumnText": "Wählen Sie eine Spalte aus", "controls.controlGroup.manageControl.dataSource.valuesPreview.title": "Vorschau der Werte", "controls.controlGroup.manageControl.displaySettings.titleInputTitle": "Label", "controls.controlGroup.manageControl.editFlyoutTitle": "Steuerungen bearbeiten", @@ -3497,9 +3486,6 @@ "esql.flyout.controlTypeOptions.valuesFromQueryLabel": "Werte aus einer Abfrage", "esql.flyout.controlTypeOptionsOptions.disabledTooltip": "Derzeit ist nur der Typ [Static values] verfügbar, um Funktionen oder Feldnamen zu ersetzen.", "esql.flyout.controlTypeOptionsOptions.label": "Typ", - "esql.flyout.displayMultipleColsCallout.description": "Ihre Abfrage gibt derzeit {totalColumns} Spalten zurück. Wählen Sie die Spalte {chooseColumnPopover} oder nutzen Sie {boldText}.", - "esql.flyout.displayMultipleColsCallout.title": "Ihre Abfrage muss eine einzelne Spalte zurückgeben", - "esql.flyout.displayNoValuesForControlCallout.title": "Diese Abfrage liefert keine Werte zurück. Bearbeiten Sie sie und führen Sie sie erneut aus.", "esql.flyout.editTitle": "Variablenkontrolle bearbeiten", "esql.flyout.experimentalLabel.content": "ES|QL-Variablen befinden sich derzeit in der technischen Vorschau.", "esql.flyout.experimentalLabel.title": "Technische Vorschau", @@ -3625,6 +3611,13 @@ "esqlEditor.visor.sourcesDropdownPopoverLabel": "Datenquellen", "esqlEditor.visor.techPreviewTooltip": "Technische Vorschau", "esqlUtils.columnsErrorMsg": "Spalten können nicht geladen werden. {errorMessage}", + "esqlUtils.valuesPreview.emptyText": "Diese Abfrage liefert keine Werte. Bearbeiten Sie sie und führen Sie sie erneut aus.", + "esqlUtils.valuesPreview.emptyTitle": "Keine Werte", + "esqlUtils.valuesPreview.errorTitle": "Fehler beim Abrufen der Wertevorschau", + "esqlUtils.valuesPreview.maxText": "Maximalwert", + "esqlUtils.valuesPreview.minText": "Mindestwert", + "esqlUtils.valuesPreview.multiColumnErrorBody": "Ihre Abfrage ergibt derzeit {totalColumns} Spalten. Wählen Sie eine Spalte oder verwenden Sie {statsBy}, um Ihre Anfrage einzugrenzen.", + "esqlUtils.valuesPreview.multiColumnErrorTitle": "Die Abfrage muss eine einzelne Spalte zurückgeben", "esQuery.kql.errors.endOfInputText": "Ende des Eingangs", "esQuery.kql.errors.fieldNameText": "Feldname", "esQuery.kql.errors.literalText": "wörtlich", diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index 0372e261930dd..99a5ef08cad01 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -980,20 +980,9 @@ "controls.controlGroup.manageControl.dataSource.fieldListErrorTitle": "Erreur lors du chargement de la liste des champs", "controls.controlGroup.manageControl.dataSource.fieldTitle": "Champ", "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "Veuillez sélectionner une vue de données", - "controls.controlGroup.manageControl.dataSource.valuesPreview.columnsListLabel": "Colonnes", "controls.controlGroup.manageControl.dataSource.valuesPreview.dataSourceLabel": "Source de données", - "esqlUtils.valuesPreview.emptyText": "Cette requête ne renvoie aucune valeur. Modifiez-la et exécutez-la à nouveau.", - "esqlUtils.valuesPreview.emptyTitle": "Aucune valeur renvoyée", - "esqlUtils.valuesPreview.errorTitle": "Erreur lors de l'obtention de l'aperçu des valeurs", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldLabel": "Champ", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldTooltipText": "Le champ sur lequel se baseront le contrôle et les options qu'il propose. Ce champ est déterminé par la colonne renvoyée par votre requête, par exemple en utilisant les commandes {statsBy} ou {rename}.", - "esqlUtils.valuesPreview.maxText": "Valeur maximale", - "esqlUtils.valuesPreview.minText": "Valeur minimale", - "esqlUtils.valuesPreview.multiColumnErrorBody": "Votre requête renvoie actuellement {totalColumns} colonnes. Choisissez une colonne, ou utilisez {statsBy} pour affiner votre requête.", - "esqlUtils.valuesPreview.multiColumnErrorTitle": "La requête doit renvoyer une seule colonne", - "controls.controlGroup.manageControl.dataSource.valuesPreview.queryNeedsRunningText": "Exécutez la requête pour obtenir un aperçu des valeurs possibles.", - "controls.controlGroup.manageControl.dataSource.valuesPreview.runQueryButton": "Exécuter la requête", - "controls.controlGroup.manageControl.dataSource.valuesPreview.selectAColumnText": "Sélectionner une colonne", "controls.controlGroup.manageControl.dataSource.valuesPreview.title": "Aperçu des valeurs", "controls.controlGroup.manageControl.displaySettings.titleInputTitle": "Étiquette", "controls.controlGroup.manageControl.editFlyoutTitle": "Modifier le contrôle", @@ -3497,9 +3486,6 @@ "esql.flyout.controlTypeOptions.valuesFromQueryLabel": "Valeurs d'une requête", "esql.flyout.controlTypeOptionsOptions.disabledTooltip": "Pour le moment, seul le type [Valeurs statiques] est proposé pour le remplacement de fonctions ou de noms de champs.", "esql.flyout.controlTypeOptionsOptions.label": "Type", - "esql.flyout.displayMultipleColsCallout.description": "Votre recherche renvoie actuellement {totalColumns} colonnes. Choisissez une colonne {chooseColumnPopover} ou utilisez {boldText}.", - "esql.flyout.displayMultipleColsCallout.title": "Votre requête doit renvoyer une seule colonne.", - "esql.flyout.displayNoValuesForControlCallout.title": "Cette requête ne renvoie aucune valeur. Modifiez-le et exécutez-le à nouveau.", "esql.flyout.editTitle": "Modifier le contrôle de variable", "esql.flyout.experimentalLabel.content": "Les variables ES|QL sont actuellement en version d'évaluation technique.", "esql.flyout.experimentalLabel.title": "Version d'évaluation technique", @@ -3625,6 +3611,13 @@ "esqlEditor.visor.sourcesDropdownPopoverLabel": "Sources de données", "esqlEditor.visor.techPreviewTooltip": "Version d'évaluation technique", "esqlUtils.columnsErrorMsg": "Impossible de charger les colonnes. {errorMessage}", + "esqlUtils.valuesPreview.emptyText": "Cette requête ne renvoie aucune valeur. Modifiez-la et exécutez-la à nouveau.", + "esqlUtils.valuesPreview.emptyTitle": "Aucune valeur renvoyée", + "esqlUtils.valuesPreview.errorTitle": "Erreur lors de l'obtention de l'aperçu des valeurs", + "esqlUtils.valuesPreview.maxText": "Valeur maximale", + "esqlUtils.valuesPreview.minText": "Valeur minimale", + "esqlUtils.valuesPreview.multiColumnErrorBody": "Votre requête renvoie actuellement {totalColumns} colonnes. Choisissez une colonne, ou utilisez {statsBy} pour affiner votre requête.", + "esqlUtils.valuesPreview.multiColumnErrorTitle": "La requête doit renvoyer une seule colonne", "esQuery.kql.errors.endOfInputText": "fin de l'entrée", "esQuery.kql.errors.fieldNameText": "nom du champ", "esQuery.kql.errors.literalText": "littéral", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index c69edd42cfb73..98b264a97d0ed 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -982,20 +982,9 @@ "controls.controlGroup.manageControl.dataSource.fieldListErrorTitle": "フィールドリストの読み込みエラー", "controls.controlGroup.manageControl.dataSource.fieldTitle": "フィールド", "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "データビューを選択してください", - "controls.controlGroup.manageControl.dataSource.valuesPreview.columnsListLabel": "列", "controls.controlGroup.manageControl.dataSource.valuesPreview.dataSourceLabel": "データソース", - "esqlUtils.valuesPreview.emptyText": "このクエリは値を返していません。編集して、再度実行してください。", - "esqlUtils.valuesPreview.emptyTitle": "値は返されませんでした", - "esqlUtils.valuesPreview.errorTitle": "値のプレビューの取得中にエラーが発生しました", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldLabel": "フィールド", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldTooltipText": "コントロールおよびそのオプションの基となるフィールド。このフィールドは、クエリによって返される列によって決定されます。たとえば、{statsBy}または{rename}コマンドを使用します。", - "esqlUtils.valuesPreview.maxText": "最高値", - "esqlUtils.valuesPreview.minText": "最小値", - "esqlUtils.valuesPreview.multiColumnErrorBody": "クエリは現在{totalColumns}列を返しています。列を選択するか、{statsBy}を使ってクエリを絞り込んでください。", - "esqlUtils.valuesPreview.multiColumnErrorTitle": "クエリは1列を返す必要があります", - "controls.controlGroup.manageControl.dataSource.valuesPreview.queryNeedsRunningText": "クエリを実行して可能な値のプレビューを取得します。", - "controls.controlGroup.manageControl.dataSource.valuesPreview.runQueryButton": "クエリを実行", - "controls.controlGroup.manageControl.dataSource.valuesPreview.selectAColumnText": "列を選択", "controls.controlGroup.manageControl.dataSource.valuesPreview.title": "値プレビュー", "controls.controlGroup.manageControl.displaySettings.titleInputTitle": "ラベル", "controls.controlGroup.manageControl.editFlyoutTitle": "コントロールを編集", @@ -3512,9 +3501,6 @@ "esql.flyout.controlTypeOptions.valuesFromQueryLabel": "クエリの値", "esql.flyout.controlTypeOptionsOptions.disabledTooltip": "現在、関数やフィールド名を置換できるのは[固定値]タイプのみです。", "esql.flyout.controlTypeOptionsOptions.label": "型", - "esql.flyout.displayMultipleColsCallout.description": "現在、クエリは{totalColumns}列を返しています。列{chooseColumnPopover}を選択するか、{boldText}を使用します。", - "esql.flyout.displayMultipleColsCallout.title": "クエリは1つの列を返す必要があります", - "esql.flyout.displayNoValuesForControlCallout.title": "このクエリは値を返していません。編集して、再度実行してください。", "esql.flyout.editTitle": "変数コントロールを編集", "esql.flyout.experimentalLabel.content": "現在、ES|QL変数はテクニカルプレビュー中です。", "esql.flyout.experimentalLabel.title": "テクニカルプレビュー", @@ -3640,6 +3626,13 @@ "esqlEditor.visor.sourcesDropdownPopoverLabel": "データソース", "esqlEditor.visor.techPreviewTooltip": "テクニカルプレビュー", "esqlUtils.columnsErrorMsg": "列を読み込めません。{errorMessage}", + "esqlUtils.valuesPreview.emptyText": "このクエリは値を返していません。編集して、再度実行してください。", + "esqlUtils.valuesPreview.emptyTitle": "値は返されませんでした", + "esqlUtils.valuesPreview.errorTitle": "値のプレビューの取得中にエラーが発生しました", + "esqlUtils.valuesPreview.maxText": "最高値", + "esqlUtils.valuesPreview.minText": "最小値", + "esqlUtils.valuesPreview.multiColumnErrorBody": "クエリは現在{totalColumns}列を返しています。列を選択するか、{statsBy}を使ってクエリを絞り込んでください。", + "esqlUtils.valuesPreview.multiColumnErrorTitle": "クエリは1列を返す必要があります", "esQuery.kql.errors.endOfInputText": "インプットの終わり", "esQuery.kql.errors.fieldNameText": "フィールド名", "esQuery.kql.errors.literalText": "文字通り", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index dde37db034e9f..a839df730ae7f 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -982,20 +982,9 @@ "controls.controlGroup.manageControl.dataSource.fieldListErrorTitle": "加载字段列表时出错", "controls.controlGroup.manageControl.dataSource.fieldTitle": "字段", "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "请选择数据视图", - "controls.controlGroup.manageControl.dataSource.valuesPreview.columnsListLabel": "列", "controls.controlGroup.manageControl.dataSource.valuesPreview.dataSourceLabel": "数据源", - "esqlUtils.valuesPreview.emptyText": "此查询未返回任何值。请编辑后再次运行。", - "esqlUtils.valuesPreview.emptyTitle": "没有值返回", - "esqlUtils.valuesPreview.errorTitle": "获取值预览时出错", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldLabel": "字段", "controls.controlGroup.manageControl.dataSource.valuesPreview.fieldTooltipText": "该控件及其提供的选项将基于该字段。此字段由您的查询返回的列确定,例如使用 {statsBy} 或 {rename} 命令。", - "esqlUtils.valuesPreview.maxText": "最大值", - "esqlUtils.valuesPreview.minText": "最小值", - "esqlUtils.valuesPreview.multiColumnErrorBody": "您的查询当前正返回 {totalColumns} 列。选择一列,或使用 {statsBy} 缩小查询范围。", - "esqlUtils.valuesPreview.multiColumnErrorTitle": "查询必须返回单列", - "controls.controlGroup.manageControl.dataSource.valuesPreview.queryNeedsRunningText": "运行查询以预览可能的值。", - "controls.controlGroup.manageControl.dataSource.valuesPreview.runQueryButton": "运行查询", - "controls.controlGroup.manageControl.dataSource.valuesPreview.selectAColumnText": "选择列", "controls.controlGroup.manageControl.dataSource.valuesPreview.title": "值预览", "controls.controlGroup.manageControl.displaySettings.titleInputTitle": "标签", "controls.controlGroup.manageControl.editFlyoutTitle": "编辑控件", @@ -3514,9 +3503,6 @@ "esql.flyout.controlTypeOptions.valuesFromQueryLabel": "查询中的值", "esql.flyout.controlTypeOptionsOptions.disabledTooltip": "当前,仅[静态值]类型可用于替代函数或字段名称。", "esql.flyout.controlTypeOptionsOptions.label": "类型", - "esql.flyout.displayMultipleColsCallout.description": "您的查询当前正返回 {totalColumns} 列。选择列 {chooseColumnPopover} 或使用 {boldText}。", - "esql.flyout.displayMultipleColsCallout.title": "您的查询必须返回单个列", - "esql.flyout.displayNoValuesForControlCallout.title": "此查询未返回任何值。请编辑后再次运行。", "esql.flyout.editTitle": "编辑变量控件", "esql.flyout.experimentalLabel.content": "ES|QL 变量当前为技术预览状态。", "esql.flyout.experimentalLabel.title": "技术预览", @@ -3642,6 +3628,13 @@ "esqlEditor.visor.sourcesDropdownPopoverLabel": "数据源", "esqlEditor.visor.techPreviewTooltip": "技术预览", "esqlUtils.columnsErrorMsg": "无法加载列。{errorMessage}", + "esqlUtils.valuesPreview.emptyText": "此查询未返回任何值。请编辑后再次运行。", + "esqlUtils.valuesPreview.emptyTitle": "没有值返回", + "esqlUtils.valuesPreview.errorTitle": "获取值预览时出错", + "esqlUtils.valuesPreview.maxText": "最大值", + "esqlUtils.valuesPreview.minText": "最小值", + "esqlUtils.valuesPreview.multiColumnErrorBody": "您的查询当前正返回 {totalColumns} 列。选择一列,或使用 {statsBy} 缩小查询范围。", + "esqlUtils.valuesPreview.multiColumnErrorTitle": "查询必须返回单列", "esQuery.kql.errors.endOfInputText": "输入结束", "esQuery.kql.errors.fieldNameText": "字段名称", "esQuery.kql.errors.literalText": "文本", From 4984274b5930026d3848ca85ef7fdd6c5a40cd12 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 16:19:27 -0600 Subject: [PATCH 11/21] rename previewOptions to values --- .../utils/controls/esql_values_preview.test.tsx | 8 ++++---- .../src/utils/controls/esql_values_preview.tsx | 15 ++++++++------- .../editor/configure_values_query.tsx | 2 +- .../control_flyout/value_control_form.tsx | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx index 973a9995b84c4..ca48df818f154 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx @@ -27,7 +27,7 @@ describe('ESQLValuesPreview', () => { @@ -44,7 +44,7 @@ describe('ESQLValuesPreview', () => { @@ -60,7 +60,7 @@ describe('ESQLValuesPreview', () => { { diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx index fb7717493797e..8b90726315f82 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx @@ -20,13 +20,14 @@ import type { DataControlType } from '@kbn/controls-constants'; import { ChooseColumnPopover } from './choose_column_popover'; export const ESQLValuesPreview: React.FC<{ - previewOptions: string[] | number[]; + // The raw values returned by the query — shown as badges or a range stat + values: string[] | number[]; previewColumns: ESQLColumn[]; previewError?: Error; updateQuery: (column: string) => void; selectedControlType?: DataControlType; -}> = ({ previewOptions, previewError, previewColumns, updateQuery, selectedControlType }) => { - const isEmpty = useMemo(() => previewOptions.length === 0, [previewOptions]); +}> = ({ values, previewError, previewColumns, updateQuery, selectedControlType }) => { + const isEmpty = useMemo(() => values.length === 0, [values]); const multiColumnResult = useMemo(() => previewColumns.length > 1, [previewColumns]); const singleColumn = useMemo( @@ -36,11 +37,11 @@ export const ESQLValuesPreview: React.FC<{ const range = useMemo(() => { if (selectedControlType === RANGE_SLIDER_CONTROL && isNumericType(singleColumn?.type)) { - const optionsAsNumbers = previewOptions.map((v) => Number(v)); + const optionsAsNumbers = values.map((v) => Number(v)); return { min: min(optionsAsNumbers), max: max(optionsAsNumbers) }; } return null; - }, [previewOptions, selectedControlType, singleColumn]); + }, [values, selectedControlType, singleColumn]); if (previewError) { return ( @@ -125,8 +126,8 @@ export const ESQLValuesPreview: React.FC<{ ); } - const visibleOptions = previewOptions.slice(0, 10); - const hiddenCount = previewOptions.length - visibleOptions.length; + const visibleOptions = values.slice(0, 10); + const hiddenCount = values.length - visibleOptions.length; return (
diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx index 8209ee5ab29ee..ddbb0b8ea24cb 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx @@ -266,7 +266,7 @@ export const ConfigureValuesQuery = ({ label={DataControlEditorStrings.manageControl.dataSource.valuesPreview.getTitle()} > v.label)} + values={selectedValues.map((v) => v.label)} previewColumns={queryColumns} previewError={esqlQueryErrors?.[0]} updateQuery={updateQuery} From 81c5f9f493aca1d158c316c28eb2fce69d083d07 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 16:21:01 -0600 Subject: [PATCH 12/21] rename previewColumns to columnts --- .../utils/controls/esql_values_preview.test.tsx | 8 ++++---- .../src/utils/controls/esql_values_preview.tsx | 15 ++++++++------- .../editor/configure_values_query.tsx | 2 +- .../control_flyout/value_control_form.tsx | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx index ca48df818f154..d050f2b63d025 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx @@ -28,7 +28,7 @@ describe('ESQLValuesPreview', () => { @@ -45,7 +45,7 @@ describe('ESQLValuesPreview', () => { @@ -82,7 +82,7 @@ describe('ESQLValuesPreview', () => { 'on her fore', 'head', ]} - previewColumns={[stringColumn]} + columns={[stringColumn]} /> ); @@ -96,7 +96,7 @@ describe('ESQLValuesPreview', () => { ); diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx index 8b90726315f82..12423a0c23287 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx @@ -22,17 +22,18 @@ import { ChooseColumnPopover } from './choose_column_popover'; export const ESQLValuesPreview: React.FC<{ // The raw values returned by the query — shown as badges or a range stat values: string[] | number[]; - previewColumns: ESQLColumn[]; + // Columns returned by the query — used to detect multi-column errors and determine value type + columns: ESQLColumn[]; previewError?: Error; updateQuery: (column: string) => void; selectedControlType?: DataControlType; -}> = ({ values, previewError, previewColumns, updateQuery, selectedControlType }) => { +}> = ({ values, previewError, columns, updateQuery, selectedControlType }) => { const isEmpty = useMemo(() => values.length === 0, [values]); - const multiColumnResult = useMemo(() => previewColumns.length > 1, [previewColumns]); + const multiColumnResult = useMemo(() => columns.length > 1, [columns]); const singleColumn = useMemo( - () => (previewColumns.length === 1 ? previewColumns[0] : null), - [previewColumns] + () => (columns.length === 1 ? columns[0] : null), + [columns] ); const range = useMemo(() => { @@ -75,11 +76,11 @@ export const ESQLValuesPreview: React.FC<{ id="esqlUtils.valuesPreview.multiColumnErrorBody" defaultMessage="Your query is currently returning {totalColumns} columns. Choose a column, or use {statsBy} to narrow your query down." values={{ - totalColumns: previewColumns.length, + totalColumns: columns.length, statsBy: STATS BY, }} /> - + ); } diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx index ddbb0b8ea24cb..dd172e453d319 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx @@ -267,7 +267,7 @@ export const ConfigureValuesQuery = ({ > v.label)} - previewColumns={queryColumns} + columns={queryColumns} previewError={esqlQueryErrors?.[0]} updateQuery={updateQuery} /> From 34dc03b0b30f8f195e6df9ce76cf7de11b8214e4 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 16:23:08 -0600 Subject: [PATCH 13/21] rename previewError to error --- .../src/utils/controls/esql_values_preview.tsx | 9 +++++---- .../data_controls/editor/configure_values_query.tsx | 2 +- .../esql_controls/control_flyout/value_control_form.tsx | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx index 12423a0c23287..dd094a9e0161f 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx @@ -24,10 +24,11 @@ export const ESQLValuesPreview: React.FC<{ values: string[] | number[]; // Columns returned by the query — used to detect multi-column errors and determine value type columns: ESQLColumn[]; - previewError?: Error; + // Query execution error; when set, renders an error callout instead of values + error?: Error; updateQuery: (column: string) => void; selectedControlType?: DataControlType; -}> = ({ values, previewError, columns, updateQuery, selectedControlType }) => { +}> = ({ values, error, columns, updateQuery, selectedControlType }) => { const isEmpty = useMemo(() => values.length === 0, [values]); const multiColumnResult = useMemo(() => columns.length > 1, [columns]); @@ -44,7 +45,7 @@ export const ESQLValuesPreview: React.FC<{ return null; }, [values, selectedControlType, singleColumn]); - if (previewError) { + if (error) { return ( -

{previewError.message}

+

{error.message}

); } diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx index dd172e453d319..ab841154b5942 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx @@ -268,7 +268,7 @@ export const ConfigureValuesQuery = ({ diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx index b8c36dc01f19a..073aa281f970e 100644 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx +++ b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/value_control_form.tsx @@ -347,7 +347,7 @@ export function ValueControlForm({ v.label)} columns={queryColumns} - previewError={esqlQueryErrors?.[0]} + error={esqlQueryErrors?.[0]} updateQuery={updateQuery} /> From 4a95951e69554157af9d7e29d92ebfdb71dce553 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 16:32:57 -0600 Subject: [PATCH 14/21] clean up --- .../utils/controls/esql_values_preview.tsx | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx index dd094a9e0161f..44a9db622eb49 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx @@ -29,21 +29,12 @@ export const ESQLValuesPreview: React.FC<{ updateQuery: (column: string) => void; selectedControlType?: DataControlType; }> = ({ values, error, columns, updateQuery, selectedControlType }) => { - const isEmpty = useMemo(() => values.length === 0, [values]); - - const multiColumnResult = useMemo(() => columns.length > 1, [columns]); - const singleColumn = useMemo( - () => (columns.length === 1 ? columns[0] : null), - [columns] - ); - const range = useMemo(() => { - if (selectedControlType === RANGE_SLIDER_CONTROL && isNumericType(singleColumn?.type)) { - const optionsAsNumbers = values.map((v) => Number(v)); - return { min: min(optionsAsNumbers), max: max(optionsAsNumbers) }; - } - return null; - }, [values, selectedControlType, singleColumn]); + if (selectedControlType !== RANGE_SLIDER_CONTROL || !isNumericType(columns?.[0]?.type)) return; + + const valuesAsNumbers = values.map((v) => Number(v)); + return { min: min(valuesAsNumbers), max: max(valuesAsNumbers) }; + }, [values, selectedControlType, columns]); if (error) { return ( @@ -61,7 +52,7 @@ export const ESQLValuesPreview: React.FC<{ ); } - if (multiColumnResult) { + if (columns.length > 1) { return ( Date: Fri, 11 Sep 2026 16:35:34 -0600 Subject: [PATCH 15/21] clean up --- .../src/utils/controls/esql_values_preview.test.tsx | 5 ++--- .../src/utils/controls/esql_values_preview.tsx | 11 +++++------ .../data_controls/editor/configure_values_query.tsx | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx index d050f2b63d025..6e77e0d85bc96 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx @@ -11,7 +11,6 @@ import React from 'react'; import { render } from '@testing-library/react'; import { I18nProvider } from '@kbn/i18n-react'; import type { ESQLColumn } from '@kbn/es-types'; -import { RANGE_SLIDER_CONTROL, OPTIONS_LIST_CONTROL } from '@kbn/controls-constants'; import { ESQLValuesPreview } from './esql_values_preview'; const noopProps = { @@ -29,7 +28,7 @@ describe('ESQLValuesPreview', () => { {...noopProps} values={[6, 7, 67]} columns={[numericColumn]} - selectedControlType={RANGE_SLIDER_CONTROL} + isRangeControl={true} /> ); @@ -46,7 +45,7 @@ describe('ESQLValuesPreview', () => { {...noopProps} values={[6, 7, 67]} columns={[numericColumn]} - selectedControlType={OPTIONS_LIST_CONTROL} + isRangeControl={false} /> ); diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx index 44a9db622eb49..3d220ef70e8f1 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx @@ -15,8 +15,6 @@ import { isNumericType } from '@kbn/esql-language'; import { EMPTY_LABEL } from '@kbn/field-formats-common'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { RANGE_SLIDER_CONTROL } from '@kbn/controls-constants'; -import type { DataControlType } from '@kbn/controls-constants'; import { ChooseColumnPopover } from './choose_column_popover'; export const ESQLValuesPreview: React.FC<{ @@ -27,14 +25,15 @@ export const ESQLValuesPreview: React.FC<{ // Query execution error; when set, renders an error callout instead of values error?: Error; updateQuery: (column: string) => void; - selectedControlType?: DataControlType; -}> = ({ values, error, columns, updateQuery, selectedControlType }) => { + // When true and the column is numeric, renders a min/max range stat instead of badges + isRangeControl?: boolean; +}> = ({ values, error, columns, updateQuery, isRangeControl }) => { const range = useMemo(() => { - if (selectedControlType !== RANGE_SLIDER_CONTROL || !isNumericType(columns?.[0]?.type)) return; + if (!isRangeControl || !isNumericType(columns?.[0]?.type)) return; const valuesAsNumbers = values.map((v) => Number(v)); return { min: min(valuesAsNumbers), max: max(valuesAsNumbers) }; - }, [values, selectedControlType, columns]); + }, [values, isRangeControl, columns]); if (error) { return ( diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx index ab841154b5942..9a61319a75bce 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx @@ -27,7 +27,7 @@ import { ESQLLangEditor } from '@kbn/esql/public'; import type { ESQLColumn } from '@kbn/es-types'; import type { ESQLControlVariable } from '@kbn/esql-types'; import { apiCanAddNewPanel, apiCanPinPanels } from '@kbn/presentation-publishing'; -import { DEFAULT_ESQL_OPTIONS_LIST_STATE, ESQL_CONTROL } from '@kbn/controls-constants'; +import { DEFAULT_ESQL_OPTIONS_LIST_STATE, ESQL_CONTROL, RANGE_SLIDER_CONTROL } from '@kbn/controls-constants'; import type { DataControlType } from '@kbn/controls-constants'; import { ESQLValuesPreview } from '@kbn/esql-utils'; import { dataService } from '../../../services/kibana_services'; @@ -270,7 +270,7 @@ export const ConfigureValuesQuery = ({ columns={previewColumns} error={previewError} updateQuery={appendColumnToESQLQuery} - selectedControlType={selectedControlType} + isRangeControl={selectedControlType === RANGE_SLIDER_CONTROL} /> )} From 571946b08e3517cadfa1d39a9823e79f88963815 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 16:38:15 -0600 Subject: [PATCH 16/21] remove DATA_CONTROL_TYPE --- .../controls/controls-constants/index.ts | 1 - .../src/control_constants.ts | 2 -- .../editor/configure_values_query.tsx | 10 +++++++--- .../editor/data_control_editor.tsx | 20 +++++++++++-------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/platform/packages/shared/controls/controls-constants/index.ts b/src/platform/packages/shared/controls/controls-constants/index.ts index a3ab57265fb0c..eefabb380a74a 100644 --- a/src/platform/packages/shared/controls/controls-constants/index.ts +++ b/src/platform/packages/shared/controls/controls-constants/index.ts @@ -26,7 +26,6 @@ export { ControlValuesSource, SELECTIONS_MAX, } from './src/control_constants'; -export type { DataControlType } from './src/control_constants'; export { DEFAULT_DSL_OPTIONS_LIST_STATE, DEFAULT_ESQL_OPTIONS_LIST_STATE, diff --git a/src/platform/packages/shared/controls/controls-constants/src/control_constants.ts b/src/platform/packages/shared/controls/controls-constants/src/control_constants.ts index a011f17e0013c..6c073cd0bf9e5 100644 --- a/src/platform/packages/shared/controls/controls-constants/src/control_constants.ts +++ b/src/platform/packages/shared/controls/controls-constants/src/control_constants.ts @@ -13,8 +13,6 @@ export const OPTIONS_LIST_CONTROL = 'options_list_control'; export const RANGE_SLIDER_CONTROL = 'range_slider_control'; export const TIME_SLIDER_CONTROL = 'time_slider_control'; -export type DataControlType = typeof OPTIONS_LIST_CONTROL | typeof RANGE_SLIDER_CONTROL; - export const DEFAULT_DATA_CONTROL_STATE = { use_global_filters: true, ignore_validations: false, diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx index 9a61319a75bce..48cdaecc69c83 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx @@ -27,8 +27,12 @@ import { ESQLLangEditor } from '@kbn/esql/public'; import type { ESQLColumn } from '@kbn/es-types'; import type { ESQLControlVariable } from '@kbn/esql-types'; import { apiCanAddNewPanel, apiCanPinPanels } from '@kbn/presentation-publishing'; -import { DEFAULT_ESQL_OPTIONS_LIST_STATE, ESQL_CONTROL, RANGE_SLIDER_CONTROL } from '@kbn/controls-constants'; -import type { DataControlType } from '@kbn/controls-constants'; +import { + DEFAULT_ESQL_OPTIONS_LIST_STATE, + ESQL_CONTROL, + OPTIONS_LIST_CONTROL, + RANGE_SLIDER_CONTROL, +} from '@kbn/controls-constants'; import { ESQLValuesPreview } from '@kbn/esql-utils'; import { dataService } from '../../../services/kibana_services'; import { getESQLSingleColumnValues } from '../../../../common/options_list'; @@ -44,7 +48,7 @@ interface ConfigureValuesQueryProps { isEdit: boolean; esqlVariables?: ESQLControlVariable[]; parentApi?: unknown; - selectedControlType?: DataControlType; + selectedControlType?: typeof OPTIONS_LIST_CONTROL | typeof RANGE_SLIDER_CONTROL; // Re-opens the parent data control editor flyout. Used after the inner ESQL variable // control creation flyout closes reopenEditor?: (overrides?: Partial) => void; diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx index 1473393a91a57..d9f2cbdf59b47 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx @@ -43,8 +43,12 @@ import { KbnDangerCallout } from '@kbn/ui-callout'; import { triggers } from '@kbn/ui-actions-plugin/public'; import { CONTROL_MENU_TRIGGER } from '@kbn/ui-actions-plugin/common/trigger_ids'; -import { ControlValuesSource, DEFAULT_CONTROL_VALUES_SOURCE } from '@kbn/controls-constants'; -import type { DataControlType } from '@kbn/controls-constants'; +import { + ControlValuesSource, + DEFAULT_CONTROL_VALUES_SOURCE, + OPTIONS_LIST_CONTROL, + RANGE_SLIDER_CONTROL, +} from '@kbn/controls-constants'; import { useStateFromPublishingSubject } from '@kbn/presentation-publishing'; import type { PublishesESQLVariables } from '@kbn/esql-types'; import { type CreateControlTypeAction } from '../../../actions/control_panel_actions'; @@ -60,7 +64,7 @@ import { ConfigureValuesQuery } from './configure_values_query'; export interface ControlEditorProps { initialState: Partial; - controlType?: DataControlType; + controlType?: typeof OPTIONS_LIST_CONTROL | typeof RANGE_SLIDER_CONTROL; controlId?: string; initialDefaultPanelTitle?: string; parentApi: unknown; @@ -112,8 +116,8 @@ const CompatibleControlTypesComponent = ({ selectedControlType: selectedAction, setSelectedControlType: setSelectedAction, }: Partial & { - selectedControlType?: DataControlType; - setSelectedControlType: (type: DataControlType) => void; + selectedControlType?: typeof OPTIONS_LIST_CONTROL | typeof RANGE_SLIDER_CONTROL; + setSelectedControlType: (type: typeof OPTIONS_LIST_CONTROL | typeof RANGE_SLIDER_CONTROL) => void; }) => { const controlActionRegistry = useControlActionRegistry(); const [isCompatible, setIsCompatible] = useState<{ [type: string]: boolean }>({}); @@ -163,7 +167,7 @@ const CompatibleControlTypesComponent = ({ data-test-subj={`create__${action.type}`} isSelected={action.type === selectedAction} disabled={disabled} - onClick={() => setSelectedAction(action.type as DataControlType)} + onClick={() => setSelectedAction(action.type as typeof OPTIONS_LIST_CONTROL | typeof RANGE_SLIDER_CONTROL)} label={action.getDisplayName(controlTypeContext)} > (initialState.title ?? defaultPanelTitle); - const [selectedControlType, setSelectedControlType] = useState( + const [selectedControlType, setSelectedControlType] = useState( controlType ); const [controlOptionsValid, setControlOptionsValid] = useState(true); @@ -338,7 +342,7 @@ export const DataControlEditor = Date: Fri, 11 Sep 2026 16:47:25 -0600 Subject: [PATCH 17/21] clean up --- .../data_controls/editor/configure_values_query.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx index 48cdaecc69c83..ed97608f1d605 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx @@ -162,11 +162,6 @@ export const ConfigureValuesQuery = ({ [editorState.esql_query] ); - const singleColumn = useMemo( - () => (previewColumns.length === 1 ? previewColumns[0] : null), - [previewColumns] - ); - const controlsContext = useMemo(() => { const supportsControls = apiCanAddNewPanel(parentApi) || apiCanPinPanels(parentApi); if (!supportsControls) return undefined; @@ -235,7 +230,7 @@ export const ConfigureValuesQuery = ({ ) : ( <> - {singleColumn && ( + {previewColumns.length === 1 && ( <> @@ -258,7 +253,7 @@ export const ConfigureValuesQuery = ({ } > - {singleColumn.name} + {previewColumns[0].name} From 4964197dadd9beb8901cb15d12ede8e57e9a068a Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 11 Sep 2026 16:51:17 -0600 Subject: [PATCH 18/21] remove unused component --- .../choose_column_popover.test.tsx | 62 ------------- .../control_flyout/choose_column_popover.tsx | 91 ------------------- 2 files changed, 153 deletions(-) delete mode 100644 src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/choose_column_popover.test.tsx delete mode 100644 src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/choose_column_popover.tsx diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/choose_column_popover.test.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/choose_column_popover.test.tsx deleted file mode 100644 index b0940aaca7df1..0000000000000 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/choose_column_popover.test.tsx +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { render, screen, fireEvent } from '@testing-library/react'; -import { userEvent } from '@testing-library/user-event'; -import { ChooseColumnPopover } from './choose_column_popover'; - -describe('ChooseColumnPopover', () => { - it('should render a search input and a list', async () => { - const user = userEvent.setup(); - render(); - // open the popover - await user.click(screen.getByTestId('chooseColumnBtn')); - // expect the search input to be rendered - expect(screen.getByTestId('selectableColumnSearch')).toBeInTheDocument(); - expect(screen.getByTestId('selectableColumnList')).toBeInTheDocument(); - }); - - it('should update the list when there is a text in the input', async () => { - const user = userEvent.setup(); - render(); - // open the popover - await user.click(screen.getByTestId('chooseColumnBtn')); - // expect the search input to be rendered - - // type in the search input - const input = screen.getByTestId('selectableColumnSearch'); - fireEvent.change(input, { target: { value: 'col2' } }); - - // get the list - const list = screen.getByTestId('selectableColumnList'); - const listItems = list.querySelector('li'); - expect(listItems).toHaveTextContent('col2'); - }); - - it('should call the updateQuery prop if a list item is clicked', async () => { - const user = userEvent.setup(); - const updateQuerySpy = jest.fn(); - render(); - // open the popover - await user.click(screen.getByTestId('chooseColumnBtn')); - // expect the search input to be rendered - - // type in the search input - const input = screen.getByTestId('selectableColumnSearch'); - fireEvent.change(input, { target: { value: 'col2' } }); - - const list = screen.getByTestId('selectableColumnList'); - const listItems = list.querySelector('li'); - - // click the list item - if (listItems) await user.click(listItems); - expect(updateQuerySpy).toHaveBeenCalledWith('col2'); - }); -}); diff --git a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/choose_column_popover.tsx b/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/choose_column_popover.tsx deleted file mode 100644 index d4c0ff8498789..0000000000000 --- a/src/platform/plugins/shared/esql/public/triggers/esql_controls/control_flyout/choose_column_popover.tsx +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useCallback, useState } from 'react'; -import { i18n } from '@kbn/i18n'; -import type { EuiSelectableOption } from '@elastic/eui'; -import { EuiLink, EuiPopover, EuiSelectable } from '@elastic/eui'; -import { css } from '@emotion/react'; - -export function ChooseColumnPopover({ - columns, - updateQuery, -}: { - columns: string[]; - updateQuery: (column: string) => void; -}) { - const [isPopoverOpen, setIsPopoverOpen] = useState(false); - const [options, setOptions] = useState( - columns.map((column) => ({ label: column })) - ); - - const onButtonClick = () => setIsPopoverOpen((status) => !status); - const closePopover = () => setIsPopoverOpen(false); - - const button = ( - - {i18n.translate('esql.flyout.chooseColumnBtn.label', { - defaultMessage: 'here', - })} - - ); - - const onColumnChange = useCallback( - (newOptions: EuiSelectableOption[]) => { - setOptions(newOptions); - - const selectedColumn = newOptions.find((option) => option.checked === 'on'); - if (selectedColumn) { - updateQuery(selectedColumn.label); - } - }, - [updateQuery] - ); - - return ( - - - {(list, search) => ( - <> - {search} - {list} - - )} - - - ); -} From 85d3b496f3aea0079630461ff575eb088a729377 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 11 Sep 2026 23:01:39 +0000 Subject: [PATCH 19/21] Changes from node scripts/check --- .../controls/esql_values_preview.test.tsx | 6 +---- .../editor/configure_values_query.tsx | 2 +- .../editor/data_control_editor.tsx | 25 +++++++++++-------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx index 6e77e0d85bc96..82db248213204 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.test.tsx @@ -92,11 +92,7 @@ describe('ESQLValuesPreview', () => { it('shows the column picker when the query returns multiple columns', () => { const { getByText, getByTestId } = render( - + ); diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx index ed97608f1d605..af56642f7a53e 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/configure_values_query.tsx @@ -27,10 +27,10 @@ import { ESQLLangEditor } from '@kbn/esql/public'; import type { ESQLColumn } from '@kbn/es-types'; import type { ESQLControlVariable } from '@kbn/esql-types'; import { apiCanAddNewPanel, apiCanPinPanels } from '@kbn/presentation-publishing'; +import type { OPTIONS_LIST_CONTROL } from '@kbn/controls-constants'; import { DEFAULT_ESQL_OPTIONS_LIST_STATE, ESQL_CONTROL, - OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL, } from '@kbn/controls-constants'; import { ESQLValuesPreview } from '@kbn/esql-utils'; diff --git a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx index d9f2cbdf59b47..3deb066ebe2f4 100644 --- a/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx +++ b/src/platform/plugins/shared/controls/public/controls/data_controls/editor/data_control_editor.tsx @@ -43,12 +43,8 @@ import { KbnDangerCallout } from '@kbn/ui-callout'; import { triggers } from '@kbn/ui-actions-plugin/public'; import { CONTROL_MENU_TRIGGER } from '@kbn/ui-actions-plugin/common/trigger_ids'; -import { - ControlValuesSource, - DEFAULT_CONTROL_VALUES_SOURCE, - OPTIONS_LIST_CONTROL, - RANGE_SLIDER_CONTROL, -} from '@kbn/controls-constants'; +import type { OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL } from '@kbn/controls-constants'; +import { ControlValuesSource, DEFAULT_CONTROL_VALUES_SOURCE } from '@kbn/controls-constants'; import { useStateFromPublishingSubject } from '@kbn/presentation-publishing'; import type { PublishesESQLVariables } from '@kbn/esql-types'; import { type CreateControlTypeAction } from '../../../actions/control_panel_actions'; @@ -167,7 +163,11 @@ const CompatibleControlTypesComponent = ({ data-test-subj={`create__${action.type}`} isSelected={action.type === selectedAction} disabled={disabled} - onClick={() => setSelectedAction(action.type as typeof OPTIONS_LIST_CONTROL | typeof RANGE_SLIDER_CONTROL)} + onClick={() => + setSelectedAction( + action.type as typeof OPTIONS_LIST_CONTROL | typeof RANGE_SLIDER_CONTROL + ) + } label={action.getDisplayName(controlTypeContext)} > (initialState.title ?? defaultPanelTitle); - const [selectedControlType, setSelectedControlType] = useState( - controlType - ); + const [selectedControlType, setSelectedControlType] = useState< + typeof OPTIONS_LIST_CONTROL | typeof RANGE_SLIDER_CONTROL | undefined + >(controlType); const [controlOptionsValid, setControlOptionsValid] = useState(true); const editorConfig = useMemo(() => { @@ -342,7 +342,10 @@ export const DataControlEditor = Date: Mon, 14 Sep 2026 07:30:26 -0600 Subject: [PATCH 20/21] i18n --- .../plugins/private/translations/translations/de-DE.json | 4 +--- .../plugins/private/translations/translations/fr-FR.json | 4 +--- .../plugins/private/translations/translations/ja-JP.json | 4 +--- .../plugins/private/translations/translations/zh-CN.json | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/x-pack/platform/plugins/private/translations/translations/de-DE.json b/x-pack/platform/plugins/private/translations/translations/de-DE.json index 7bc0753c402eb..1d0061e875c5d 100644 --- a/x-pack/platform/plugins/private/translations/translations/de-DE.json +++ b/x-pack/platform/plugins/private/translations/translations/de-DE.json @@ -3479,9 +3479,6 @@ "esql.flyout..applyFlyoutAriaLabel": "Änderungen anwenden", "esql.flyout..cancelFlyoutAriaLabel": "Vorgenommene Änderungen abbrechen", "esql.flyout.cancelLabel": "Abbrechen", - "esql.flyout.chooseColumnBtn.label": "hier", - "esql.flyout.chooseColumnList.label": "Wählen Sie eine Spalte aus", - "esql.flyout.chooseColumnPopoverLabel": "Wählen Sie eine Spalte", "esql.flyout.controlTypeOptions.staticValuesLabel": "Statische Werte", "esql.flyout.controlTypeOptions.valuesFromQueryLabel": "Werte aus einer Abfrage", "esql.flyout.controlTypeOptionsOptions.disabledTooltip": "Derzeit ist nur der Typ [Static values] verfügbar, um Funktionen oder Feldnamen zu ersetzen.", @@ -3618,6 +3615,7 @@ "esqlUtils.valuesPreview.minText": "Mindestwert", "esqlUtils.valuesPreview.multiColumnErrorBody": "Ihre Abfrage ergibt derzeit {totalColumns} Spalten. Wählen Sie eine Spalte oder verwenden Sie {statsBy}, um Ihre Anfrage einzugrenzen.", "esqlUtils.valuesPreview.multiColumnErrorTitle": "Die Abfrage muss eine einzelne Spalte zurückgeben", + "esqlUtils.valuesPreview.selectAColumnText": "Wählen Sie eine Spalte aus", "esQuery.kql.errors.endOfInputText": "Ende des Eingangs", "esQuery.kql.errors.fieldNameText": "Feldname", "esQuery.kql.errors.literalText": "wörtlich", diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index 99a5ef08cad01..ceb0a535e21fc 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -3479,9 +3479,6 @@ "esql.flyout..applyFlyoutAriaLabel": "Appliquer les modifications", "esql.flyout..cancelFlyoutAriaLabel": "Annuler les changements appliqués", "esql.flyout.cancelLabel": "Annuler", - "esql.flyout.chooseColumnBtn.label": "ici", - "esql.flyout.chooseColumnList.label": "Sélectionnez une colonne", - "esql.flyout.chooseColumnPopoverLabel": "Choisir une colonne", "esql.flyout.controlTypeOptions.staticValuesLabel": "Valeurs statiques", "esql.flyout.controlTypeOptions.valuesFromQueryLabel": "Valeurs d'une requête", "esql.flyout.controlTypeOptionsOptions.disabledTooltip": "Pour le moment, seul le type [Valeurs statiques] est proposé pour le remplacement de fonctions ou de noms de champs.", @@ -3618,6 +3615,7 @@ "esqlUtils.valuesPreview.minText": "Valeur minimale", "esqlUtils.valuesPreview.multiColumnErrorBody": "Votre requête renvoie actuellement {totalColumns} colonnes. Choisissez une colonne, ou utilisez {statsBy} pour affiner votre requête.", "esqlUtils.valuesPreview.multiColumnErrorTitle": "La requête doit renvoyer une seule colonne", + "esqlUtils.valuesPreview.selectAColumnText": "Sélectionnez une colonne", "esQuery.kql.errors.endOfInputText": "fin de l'entrée", "esQuery.kql.errors.fieldNameText": "nom du champ", "esQuery.kql.errors.literalText": "littéral", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index 98b264a97d0ed..01fae63e742b1 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -3494,9 +3494,6 @@ "esql.flyout..applyFlyoutAriaLabel": "変更を適用", "esql.flyout..cancelFlyoutAriaLabel": "適用された変更をキャンセル", "esql.flyout.cancelLabel": "キャンセル", - "esql.flyout.chooseColumnBtn.label": "こちら", - "esql.flyout.chooseColumnList.label": "列を選択", - "esql.flyout.chooseColumnPopoverLabel": "列を選択してください", "esql.flyout.controlTypeOptions.staticValuesLabel": "固定値", "esql.flyout.controlTypeOptions.valuesFromQueryLabel": "クエリの値", "esql.flyout.controlTypeOptionsOptions.disabledTooltip": "現在、関数やフィールド名を置換できるのは[固定値]タイプのみです。", @@ -3633,6 +3630,7 @@ "esqlUtils.valuesPreview.minText": "最小値", "esqlUtils.valuesPreview.multiColumnErrorBody": "クエリは現在{totalColumns}列を返しています。列を選択するか、{statsBy}を使ってクエリを絞り込んでください。", "esqlUtils.valuesPreview.multiColumnErrorTitle": "クエリは1列を返す必要があります", + "esqlUtils.valuesPreview.selectAColumnText": "列を選択", "esQuery.kql.errors.endOfInputText": "インプットの終わり", "esQuery.kql.errors.fieldNameText": "フィールド名", "esQuery.kql.errors.literalText": "文字通り", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index a839df730ae7f..bcd1125302e3d 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -3496,9 +3496,6 @@ "esql.flyout..applyFlyoutAriaLabel": "应用更改", "esql.flyout..cancelFlyoutAriaLabel": "取消已应用的更改", "esql.flyout.cancelLabel": "取消", - "esql.flyout.chooseColumnBtn.label": "此处", - "esql.flyout.chooseColumnList.label": "选择列", - "esql.flyout.chooseColumnPopoverLabel": "选择一列", "esql.flyout.controlTypeOptions.staticValuesLabel": "静态值", "esql.flyout.controlTypeOptions.valuesFromQueryLabel": "查询中的值", "esql.flyout.controlTypeOptionsOptions.disabledTooltip": "当前,仅[静态值]类型可用于替代函数或字段名称。", @@ -3635,6 +3632,7 @@ "esqlUtils.valuesPreview.minText": "最小值", "esqlUtils.valuesPreview.multiColumnErrorBody": "您的查询当前正返回 {totalColumns} 列。选择一列,或使用 {statsBy} 缩小查询范围。", "esqlUtils.valuesPreview.multiColumnErrorTitle": "查询必须返回单列", + "esqlUtils.valuesPreview.selectAColumnText": "选择列", "esQuery.kql.errors.endOfInputText": "输入结束", "esQuery.kql.errors.fieldNameText": "字段名称", "esQuery.kql.errors.literalText": "文本", From cb127fe219e17fe74e9f3cd87f00fb69295cd739 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 14 Sep 2026 08:11:38 -0600 Subject: [PATCH 21/21] use KbnCallout --- .../utils/controls/esql_values_preview.tsx | 52 ++++++++----------- .../shared/kbn-esql-utils/tsconfig.json | 1 + 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx index 3d220ef70e8f1..73e7c30d5f6b6 100644 --- a/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx +++ b/src/platform/packages/shared/kbn-esql-utils/src/utils/controls/esql_values_preview.tsx @@ -8,13 +8,15 @@ */ import React, { useMemo } from 'react'; -import { EuiBadge, EuiBadgeGroup, EuiCallOut, EuiCode, EuiFlexGrid, EuiStat } from '@elastic/eui'; +import { EuiBadge, EuiBadgeGroup, EuiCode, EuiFlexGrid, EuiStat } from '@elastic/eui'; import { max, min } from 'lodash'; import type { ESQLColumn } from '@kbn/es-types'; import { isNumericType } from '@kbn/esql-language'; import { EMPTY_LABEL } from '@kbn/field-formats-common'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +// eslint-disable-next-line @kbn/imports/no_boundary_crossing +import { KbnDangerCallout, KbnWarningCallout } from '@kbn/ui-callout'; import { ChooseColumnPopover } from './choose_column_popover'; export const ESQLValuesPreview: React.FC<{ @@ -37,63 +39,55 @@ export const ESQLValuesPreview: React.FC<{ if (error) { return ( - -

{error.message}

-
+ text={error.message} + /> ); } if (columns.length > 1) { return ( - STATS BY, + }} + /> + } > - STATS BY, - }} - /> - + ); } if (values.length === 0) { return ( - -

- {i18n.translate('esqlUtils.valuesPreview.emptyText', { - defaultMessage: "This query isn't returning any values. Edit it and run it again.", - })} -

-
+ text={i18n.translate('esqlUtils.valuesPreview.emptyText', { + defaultMessage: "This query isn't returning any values. Edit it and run it again.", + })} + /> ); } diff --git a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json index e3e9b3b98aeff..54a8a59e4135a 100644 --- a/src/platform/packages/shared/kbn-esql-utils/tsconfig.json +++ b/src/platform/packages/shared/kbn-esql-utils/tsconfig.json @@ -37,5 +37,6 @@ "@kbn/controls-constants", "@kbn/presentation-publishing", "@kbn/controls-schemas", + "@kbn/ui-callout", ] }