move text based ds files (#218386)

This commit is contained in:
Peter Pisljar 2025-04-17 08:29:09 +02:00 committed by GitHub
parent 01a9a6660c
commit 01e873ce29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 48 additions and 51 deletions

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import type { TextBasedLayerColumn } from '@kbn/lens-plugin/public/datasources/text_based/types';
import type { TextBasedLayerColumn } from '@kbn/lens-plugin/public/datasources/form_based/esql_layer/types';
import type { DatatableColumnType } from '@kbn/expressions-plugin/common';
export function getValueColumn(

View file

@ -18,7 +18,7 @@ import type {
import type {
TextBasedLayerColumn,
TextBasedPersistedState,
} from '@kbn/lens-plugin/public/datasources/text_based/types';
} from '@kbn/lens-plugin/public/datasources/form_based/esql_layer/types';
import type { AggregateQuery } from '@kbn/es-query';
import { getIndexPatternFromESQLQuery } from '@kbn/esql-utils';
import { DataViewsCommon } from './config_builder';

View file

@ -10,7 +10,7 @@
import { isEqual, cloneDeep } from 'lodash';
import type { DataView } from '@kbn/data-views-plugin/common';
import type { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query';
import type { TextBasedLayerColumn } from '@kbn/lens-plugin/public/datasources/text_based/types';
import type { TextBasedLayerColumn } from '@kbn/lens-plugin/public/datasources/form_based/esql_layer/types';
import { getDatasourceId } from '@kbn/visualization-utils';
import type { DatatableColumn } from '@kbn/expressions-plugin/common';
import type { PieVisualizationState, Suggestion, XYState } from '@kbn/lens-plugin/public';

View file

@ -9,7 +9,7 @@
import type { Datatable } from '@kbn/expressions-plugin/common';
import type { LensAttributes } from '@kbn/lens-embeddable-utils';
import type { TextBasedPersistedState } from '@kbn/lens-plugin/public/datasources/text_based/types';
import type { TextBasedPersistedState } from '@kbn/lens-plugin/public/datasources/form_based/esql_layer/types';
import type { TypedLensByValueInput } from '@kbn/lens-plugin/public';
export const enrichLensAttributesWithTablesData = ({

View file

@ -34,11 +34,11 @@ export * from './visualizations/tagcloud';
export { getEditLensConfiguration } from './app_plugin/shared/edit_on_the_fly/get_edit_lens_configuration';
export * from './datasources/form_based/form_based';
export { getTextBasedDatasource } from './datasources/text_based/text_based_languages';
export { getTextBasedDatasource } from './datasources/form_based/esql_layer/text_based_languages';
export { createFormulaPublicApi } from './datasources/form_based/operations/definitions/formula/formula_public_api';
export * from './lens_suggestions_api';
export * from './datasources/text_based';
export * from './datasources/form_based/esql_layer';
export * from './datasources/form_based';
export * from './lens_ui_telemetry';
export * from './lens_ui_errors';

View file

@ -28,7 +28,7 @@ import {
} from '@kbn/field-formats-plugin/common';
import { css } from '@emotion/react';
import type { DocLinksStart } from '@kbn/core/public';
import { TextBasedLayerColumn } from '../../text_based/types';
import { TextBasedLayerColumn } from '../esql_layer/types';
import { LensAppServices } from '../../../app_plugin/types';
import { GenericIndexPatternColumn } from '../form_based';
import { isColumnFormatted } from '../operations/definitions/helpers';

View file

@ -24,9 +24,9 @@ import { render, screen, within } from '@testing-library/react';
import { type TextBasedDataPanelProps, TextBasedDataPanel } from './datapanel';
import type { TextBasedPrivateState } from '../types';
import { createIndexPatternServiceMock } from '../../../mocks/data_views_service_mock';
import { createMockFramePublicAPI } from '../../../mocks';
import { DataViewsState } from '../../../state_management';
import { createIndexPatternServiceMock } from '../../../../mocks/data_views_service_mock';
import { createMockFramePublicAPI } from '../../../../mocks';
import { DataViewsState } from '../../../../state_management';
import { addColumnsToCache } from '../fieldlist_cache';
const fieldsFromQuery = [

View file

@ -26,12 +26,12 @@ import {
} from '@kbn/unified-field-list';
import { OverrideFieldGroupDetails } from '@kbn/unified-field-list/src/types';
import { useEuiTheme } from '@elastic/eui';
import type { DatasourceDataPanelProps } from '../../../types';
import type { DatasourceDataPanelProps } from '../../../../types';
import type { TextBasedPrivateState } from '../types';
import { getStateFromAggregateQuery } from '../utils';
import { FieldItem } from '../../common/field_item';
import { FieldItem } from '../../../common/field_item';
import { getColumnsFromCache } from '../fieldlist_cache';
import { dataPanelStyles } from '../../common/datapanel.styles';
import { dataPanelStyles } from '../../../common/datapanel.styles';
const getCustomFieldType: GetCustomFieldType<DatatableColumn> = (field) => field?.meta.type;

View file

@ -14,11 +14,8 @@ import { fetchFieldsFromESQL } from '@kbn/esql-editor';
import { NameInput } from '@kbn/visualization-ui-components';
import { css } from '@emotion/react';
import { mergeLayer, updateColumnFormat, updateColumnLabel } from '../utils';
import {
FormatSelector,
FormatSelectorProps,
} from '../../form_based/dimension_panel/format_selector';
import type { DatasourceDimensionEditorProps, DataType } from '../../../types';
import { FormatSelector, FormatSelectorProps } from '../../dimension_panel/format_selector';
import type { DatasourceDimensionEditorProps, DataType } from '../../../../types';
import { FieldSelect, type FieldOptionCompatible } from './field_select';
import type { TextBasedPrivateState } from '../types';
import { isNotNumeric, isNumeric } from '../utils';

View file

@ -9,7 +9,7 @@ import React from 'react';
import { i18n } from '@kbn/i18n';
import { DimensionTrigger } from '@kbn/visualization-ui-components';
import type { ExpressionsStart } from '@kbn/expressions-plugin/public';
import type { DatasourceDimensionTriggerProps } from '../../../types';
import type { DatasourceDimensionTriggerProps } from '../../../../types';
import type { TextBasedPrivateState } from '../types';
export type TextBasedDimensionTrigger = DatasourceDimensionTriggerProps<TextBasedPrivateState> & {

View file

@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n';
import type { DatatableColumn } from '@kbn/expressions-plugin/public';
import { FieldPicker, FieldOptionValue, FieldOption } from '@kbn/visualization-ui-components';
import type { TextBasedLayerColumn } from '../types';
import type { DataType } from '../../../types';
import type { DataType } from '../../../../types';
export interface FieldOptionCompatible extends DatatableColumn {
compatible: boolean;

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import type { DatatableColumn } from '@kbn/expressions-plugin/common';
import { DatasourceDimensionDropHandlerProps } from '../../../types';
import { DatasourceDimensionDropHandlerProps } from '../../../../types';
import { getDropProps } from './get_drop_props';
import {
column1,

View file

@ -6,10 +6,10 @@
*/
import { DropType } from '@kbn/dom-drag-drop';
import { isOperation } from '../../../types';
import { isOperation } from '../../../../types';
import type { TextBasedPrivateState } from '../types';
import type { GetDropPropsArgs } from '../../../types';
import { isDraggedField, isOperationFromTheSameGroup } from '../../../utils';
import type { GetDropPropsArgs } from '../../../../types';
import { isDraggedField, isOperationFromTheSameGroup } from '../../../../utils';
import { canColumnBeDroppedInMetricDimension, isNotNumeric } from '../utils';
import { retrieveLayerColumnsFromCache } from '../fieldlist_cache';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { DatasourceDimensionDropHandlerProps } from '../../../types';
import { DatasourceDimensionDropHandlerProps } from '../../../../types';
import { TextBasedPrivateState } from '../types';
export const column1 = {

View file

@ -9,7 +9,7 @@ import { DropType } from '@kbn/dom-drag-drop';
import type { DatatableColumn } from '@kbn/expressions-plugin/common';
import { onDrop } from './on_drop';
import { column1, column2, column3, emptyDimensionTarget, defaultProps, fieldList } from './mocks';
import { DatasourceDimensionDropHandlerProps } from '../../../types';
import { DatasourceDimensionDropHandlerProps } from '../../../../types';
import { TextBasedPrivateState } from '../types';
import { addColumnsToCache } from '../fieldlist_cache';

View file

@ -6,8 +6,8 @@
*/
import type { TextBasedLayerColumn, TextBasedPrivateState } from '../types';
import { reorderElements } from '../../../utils';
import { DatasourceDimensionDropHandlerProps, isOperation } from '../../../types';
import { reorderElements } from '../../../../utils';
import { DatasourceDimensionDropHandlerProps, isOperation } from '../../../../types';
import { removeColumn } from '../remove_column';
import { retrieveLayerColumnsFromCache } from '../fieldlist_cache';

View file

@ -10,7 +10,7 @@ import { Storage } from '@kbn/kibana-utils-plugin/public';
import { ExpressionsStart } from '@kbn/expressions-plugin/public';
import { DataPublicPluginSetup, DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
import { EditorFrameSetup } from '../../types';
import { EditorFrameSetup } from '../../../types';
export interface TextBasedSetupPlugins {
data: DataPublicPluginSetup;
@ -29,7 +29,7 @@ export class TextBasedDatasource {
setup(core: CoreSetup<TextBasedStartPlugins>, { editorFrame }: TextBasedSetupPlugins) {
editorFrame.registerDatasource(async () => {
const [{ getTextBasedDatasource }, [coreStart, { data, dataViews, expressions }]] =
await Promise.all([import('../../async_services'), core.getStartServices()]);
await Promise.all([import('../../../async_services'), core.getStartServices()]);
return getTextBasedDatasource({
core: coreStart,

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { Datasource } from '../../types';
import { Datasource } from '../../../types';
import { TextBasedPrivateState } from './types';
export const removeColumn: Datasource<TextBasedPrivateState>['removeColumn'] = ({

View file

@ -12,9 +12,9 @@ import { TextBasedPersistedState, TextBasedPrivateState } from './types';
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks';
import { getTextBasedDatasource } from './text_based_languages';
import { generateId } from '../../id_generator';
import { DatasourcePublicAPI, Datasource, FramePublicAPI } from '../../types';
jest.mock('../../id_generator');
import { generateId } from '../../../id_generator';
import { DatasourcePublicAPI, Datasource, FramePublicAPI } from '../../../types';
jest.mock('../../../id_generator');
const fieldsOne = [
{

View file

@ -31,16 +31,16 @@ import {
DataSourceInfo,
UserMessage,
OperationMetadata,
} from '../../types';
import { generateId } from '../../id_generator';
} from '../../../types';
import { generateId } from '../../../id_generator';
import type {
TextBasedPrivateState,
TextBasedPersistedState,
TextBasedLayerColumn,
TextBasedField,
} from './types';
import type { Datasource, DatasourceSuggestion } from '../../types';
import { getUniqueLabelGenerator, nonNullable } from '../../utils';
import type { Datasource, DatasourceSuggestion } from '../../../types';
import { getUniqueLabelGenerator, nonNullable } from '../../../utils';
import { onDrop, getDropProps } from './dnd';
import { removeColumn } from './remove_column';
import {
@ -54,7 +54,7 @@ import {
addColumnsToCache,
retrieveLayerColumnsFromCache,
} from './fieldlist_cache';
import { TEXT_BASED_LANGUAGE_ERROR } from '../../user_messages_ids';
import { TEXT_BASED_LANGUAGE_ERROR } from '../../../user_messages_ids';
function getLayerReferenceName(layerId: string) {
return `textBasedLanguages-datasource-layer-${layerId}`;

View file

@ -10,7 +10,7 @@ import { Ast } from '@kbn/interpreter';
import { textBasedQueryStateToExpressionAst } from '@kbn/data-plugin/common';
import { ExpressionAstFunction } from '@kbn/expressions-plugin/common';
import { TextBasedPrivateState, TextBasedLayer, IndexPatternRef } from './types';
import type { OriginalColumn } from '../../../common/types';
import type { OriginalColumn } from '../../../../common/types';
function getExpressionForLayer(
layer: TextBasedLayer,

View file

@ -7,8 +7,8 @@
import type { Datatable, DatatableColumn } from '@kbn/expressions-plugin/public';
import type { AggregateQuery } from '@kbn/es-query';
import type { VisualizeFieldContext } from '@kbn/ui-actions-plugin/public';
import { ValueFormatConfig } from '../form_based/operations/definitions/column_types';
import type { VisualizeEditorContext } from '../../types';
import { ValueFormatConfig } from '../operations/definitions/column_types';
import type { VisualizeEditorContext } from '../../../types';
export interface TextBasedLayerColumn {
columnId: string;

View file

@ -9,7 +9,7 @@ import type { DatatableColumn } from '@kbn/expressions-plugin/public';
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
import { expressionsPluginMock } from '@kbn/expressions-plugin/public/mocks';
import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks';
import { mockDataViewsService } from '../../data_views_service/mocks';
import { mockDataViewsService } from '../../../data_views_service/mocks';
import {
getIndexPatternFromTextBasedQuery,
loadIndexPatternRefs,

View file

@ -11,8 +11,8 @@ import { getESQLAdHocDataview } from '@kbn/esql-utils';
import type { AggregateQuery } from '@kbn/es-query';
import { getIndexPatternFromESQLQuery } from '@kbn/esql-utils';
import type { DatatableColumn } from '@kbn/expressions-plugin/public';
import { ValueFormatConfig } from '../form_based/operations/definitions/column_types';
import { generateId } from '../../id_generator';
import { ValueFormatConfig } from '../operations/definitions/column_types';
import { generateId } from '../../../id_generator';
import { fetchDataFromAggregateQuery } from './fetch_data_from_aggregate_query';
import type {
IndexPatternRef,
@ -20,7 +20,7 @@ import type {
TextBasedLayerColumn,
TextBasedLayer,
} from './types';
import type { DataViewsState } from '../../state_management';
import type { DataViewsState } from '../../../state_management';
import { addColumnsToCache } from './fieldlist_cache';
export const MAX_NUM_OF_COLUMNS = 5;

View file

@ -10,7 +10,7 @@ import React, { Fragment } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { isEqual } from 'lodash';
import { Query } from '@kbn/es-query';
import { TextBasedLayerColumn } from '../../../text_based/types';
import { TextBasedLayerColumn } from '../../esql_layer/types';
import type { IndexPattern, IndexPatternField } from '../../../../types';
import {
type FieldBasedOperationErrorMessage,

View file

@ -26,7 +26,7 @@ import {
getSuggestions,
} from '../../../app_plugin/shared/edit_on_the_fly/helpers';
import { useESQLVariables } from '../../../app_plugin/shared/edit_on_the_fly/use_esql_variables';
import { MAX_NUM_OF_COLUMNS } from '../../../datasources/text_based/utils';
import { MAX_NUM_OF_COLUMNS } from '../../../datasources/form_based/esql_layer/utils';
import { isApiESQLVariablesCompatible } from '../../../react_embeddable/types';
import type { LayerPanelProps } from './types';
import { ESQLDataGridAccordion } from '../../../app_plugin/shared/edit_on_the_fly/esql_data_grid_accordion';

View file

@ -75,7 +75,7 @@ import type {
FormBasedDatasourceSetupPlugins,
FormulaPublicApi,
} from './datasources/form_based';
import type { TextBasedDatasource as TextBasedDatasourceType } from './datasources/text_based';
import type { TextBasedDatasource as TextBasedDatasourceType } from './datasources/form_based/esql_layer';
import type {
XyVisualization as XyVisualizationType,

View file

@ -6,7 +6,7 @@
*/
import type { Datatable } from '@kbn/expressions-plugin/common';
import type { TextBasedPersistedState } from '../../datasources/text_based/types';
import type { TextBasedPersistedState } from '../../datasources/form_based/esql_layer/types';
import { LensApi, LensRuntimeState } from '../types';
function getInternalTables(states: Record<string, unknown>) {

View file

@ -91,7 +91,7 @@ import type { LensPluginStartDependencies } from '../plugin';
import type { TableInspectorAdapter } from '../editor_frame_service/types';
import type { PieVisualizationState } from '../../common/types';
import type { FormBasedPersistedState } from '..';
import type { TextBasedPersistedState } from '../datasources/text_based/types';
import type { TextBasedPersistedState } from '../datasources/form_based/esql_layer/types';
import type { GaugeVisualizationState } from '../visualizations/gauge/constants';
import type { MetricVisualizationState } from '../visualizations/metric/types';