diff --git a/src/legacy/core_plugins/vis_default_editor/public/components/agg_param_props.ts b/src/legacy/core_plugins/vis_default_editor/public/components/agg_param_props.ts index 96e9a4d32896e..01a41d3c412c2 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/components/agg_param_props.ts +++ b/src/legacy/core_plugins/vis_default_editor/public/components/agg_param_props.ts @@ -19,9 +19,8 @@ import { Field } from 'src/plugins/data/public'; import { VisState } from 'src/legacy/core_plugins/visualizations/public'; -import { AggConfig, AggParam } from '../legacy_imports'; +import { AggConfig, AggParam, EditorConfig } from '../legacy_imports'; import { ComboBoxGroupedOptions } from '../utils'; -import { EditorConfig } from '../config/types'; // NOTE: we cannot export the interface with export { InterfaceName } // as there is currently a bug on babel typescript transform plugin for it diff --git a/src/legacy/core_plugins/vis_default_editor/public/components/agg_params.test.tsx b/src/legacy/core_plugins/vis_default_editor/public/components/agg_params.test.tsx index 2b0513a6ee625..d782c819c7c41 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/components/agg_params.test.tsx +++ b/src/legacy/core_plugins/vis_default_editor/public/components/agg_params.test.tsx @@ -36,8 +36,7 @@ const mockEditorConfig = { }; jest.mock('ui/new_platform'); - -jest.mock('../config/editor_config_providers', () => ({ +jest.mock('ui/vis/config', () => ({ editorConfigProviders: { getConfigForAgg: jest.fn(() => mockEditorConfig), }, diff --git a/src/legacy/core_plugins/vis_default_editor/public/components/agg_params.tsx b/src/legacy/core_plugins/vis_default_editor/public/components/agg_params.tsx index c342aa9dba9fc..0d83860a1475a 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/components/agg_params.tsx +++ b/src/legacy/core_plugins/vis_default_editor/public/components/agg_params.tsx @@ -23,7 +23,14 @@ import { i18n } from '@kbn/i18n'; import useUnmount from 'react-use/lib/useUnmount'; import { IndexPattern } from 'src/plugins/data/public'; -import { AggConfig, AggGroupNames } from '../legacy_imports'; +import { + AggConfig, + AggGroupNames, + editorConfigProviders, + FixedParam, + TimeIntervalParam, + EditorParamConfig, +} from '../legacy_imports'; import { DefaultEditorAggSelect } from './agg_select'; import { DefaultEditorAggParam } from './agg_param'; @@ -38,8 +45,6 @@ import { AGG_PARAMS_ACTION_KEYS, initAggParamsState, } from './agg_params_state'; -import { editorConfigProviders } from '../config/editor_config_providers'; -import { FixedParam, TimeIntervalParam, EditorParamConfig } from '../config/types'; import { DefaultEditorCommonProps } from './agg_common_props'; const FIXED_VALUE_PROP = 'fixedValue'; diff --git a/src/legacy/core_plugins/vis_default_editor/public/components/agg_params_helper.test.ts b/src/legacy/core_plugins/vis_default_editor/public/components/agg_params_helper.test.ts index 492398ac59566..6f584b4329500 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/components/agg_params_helper.test.ts +++ b/src/legacy/core_plugins/vis_default_editor/public/components/agg_params_helper.test.ts @@ -19,13 +19,19 @@ import { IndexPattern, Field } from 'src/plugins/data/public'; import { VisState } from 'src/legacy/core_plugins/visualizations/public'; -import { AggConfig, AggType, AggGroupNames, BUCKET_TYPES, IndexedArray } from '../legacy_imports'; +import { + AggConfig, + AggType, + AggGroupNames, + BUCKET_TYPES, + IndexedArray, + EditorConfig, +} from '../legacy_imports'; import { getAggParamsToRender, getAggTypeOptions, isInvalidParamsTouched, } from './agg_params_helper'; -import { EditorConfig } from '../config/types'; import { FieldParamEditor, OrderByParamEditor } from './controls'; jest.mock('../utils', () => ({ diff --git a/src/legacy/core_plugins/vis_default_editor/public/components/agg_params_helper.ts b/src/legacy/core_plugins/vis_default_editor/public/components/agg_params_helper.ts index 176085860f88c..21154bd7ad603 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/components/agg_params_helper.ts +++ b/src/legacy/core_plugins/vis_default_editor/public/components/agg_params_helper.ts @@ -22,7 +22,6 @@ import { get, isEmpty } from 'lodash'; import { IndexPattern, Field } from 'src/plugins/data/public'; import { VisState } from 'src/legacy/core_plugins/visualizations/public'; import { groupAndSortBy, ComboBoxGroupedOptions } from '../utils'; -import { EditorConfig } from '../config/types'; import { AggTypeState, AggParamsState } from './agg_params_state'; import { AggParamEditorProps } from './agg_param_props'; import { aggParamsMap } from './agg_params_map'; @@ -34,6 +33,7 @@ import { AggParam, FieldParamType, AggType, + EditorConfig, } from '../legacy_imports'; interface ParamInstanceBase { diff --git a/src/legacy/core_plugins/vis_default_editor/public/components/controls/test_utils.ts b/src/legacy/core_plugins/vis_default_editor/public/components/controls/test_utils.ts index 65fa5bdcc607a..4e811f4543412 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/components/controls/test_utils.ts +++ b/src/legacy/core_plugins/vis_default_editor/public/components/controls/test_utils.ts @@ -18,8 +18,7 @@ */ import { VisState } from 'src/legacy/core_plugins/visualizations/public'; -import { EditorConfig } from '../../config/types'; -import { AggConfig, AggParam } from '../../legacy_imports'; +import { AggConfig, AggParam, EditorConfig } from '../../legacy_imports'; export const aggParamCommonPropsMock = { agg: {} as AggConfig, diff --git a/src/legacy/core_plugins/vis_default_editor/public/index.ts b/src/legacy/core_plugins/vis_default_editor/public/index.ts index cd74dd79f1ace..fa6c2ee6d5ec7 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/index.ts +++ b/src/legacy/core_plugins/vis_default_editor/public/index.ts @@ -18,10 +18,8 @@ */ export { DefaultEditorController } from './default_editor_controller'; -export { DefaultEditorAggParams } from './components/agg_params'; export { useValidation } from './components/controls/utils'; export { RangesParamEditor, RangeValues } from './components/controls/ranges'; -export { editorConfigProviders } from './config/editor_config_providers'; export * from './editor_size'; export * from './vis_options_props'; export * from './utils'; diff --git a/src/legacy/core_plugins/vis_default_editor/public/legacy_imports.ts b/src/legacy/core_plugins/vis_default_editor/public/legacy_imports.ts index 6d7be59c4ec13..5c617f3dc8681 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/legacy_imports.ts +++ b/src/legacy/core_plugins/vis_default_editor/public/legacy_imports.ts @@ -55,3 +55,4 @@ export { getDocLink } from 'ui/documentation_links'; export { documentationLinks } from 'ui/documentation_links/documentation_links'; export { move } from 'ui/utils/collection'; export * from 'ui/vis/lib'; +export * from 'ui/vis/config'; diff --git a/src/legacy/core_plugins/vis_default_editor/public/config/editor_config_providers.test.ts b/src/legacy/ui/public/vis/config/editor_config_providers.test.ts similarity index 99% rename from src/legacy/core_plugins/vis_default_editor/public/config/editor_config_providers.test.ts rename to src/legacy/ui/public/vis/config/editor_config_providers.test.ts index c64efdbcf531d..9d93930c09ebc 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/config/editor_config_providers.test.ts +++ b/src/legacy/ui/public/vis/config/editor_config_providers.test.ts @@ -17,9 +17,9 @@ * under the License. */ +import { AggConfig } from 'ui/agg_types'; import { EditorConfigProviderRegistry } from './editor_config_providers'; import { EditorParamConfig, FixedParam, NumericIntervalParam, TimeIntervalParam } from './types'; -import { AggConfig } from '../legacy_imports'; jest.mock('ui/new_platform'); diff --git a/src/legacy/core_plugins/vis_default_editor/public/config/editor_config_providers.ts b/src/legacy/ui/public/vis/config/editor_config_providers.ts similarity index 96% rename from src/legacy/core_plugins/vis_default_editor/public/config/editor_config_providers.ts rename to src/legacy/ui/public/vis/config/editor_config_providers.ts index db4860fa9dcd9..1e82a3ca2762e 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/config/editor_config_providers.ts +++ b/src/legacy/ui/public/vis/config/editor_config_providers.ts @@ -18,8 +18,8 @@ */ import { IndexPattern } from 'src/plugins/data/public'; -import { parseEsInterval } from '../../../data/public'; -import { AggConfig, leastCommonMultiple, leastCommonInterval } from '../legacy_imports'; +import { AggConfig } from 'ui/agg_types'; +import { parseEsInterval } from '../../../../core_plugins/data/public'; import { TimeIntervalParam, EditorConfig, @@ -27,6 +27,7 @@ import { FixedParam, NumericIntervalParam, } from './types'; +import { leastCommonInterval, leastCommonMultiple } from '../lib'; type EditorConfigProvider = (indexPattern: IndexPattern, aggConfig: AggConfig) => EditorConfig; diff --git a/src/legacy/ui/public/vis/config/index.ts b/src/legacy/ui/public/vis/config/index.ts new file mode 100644 index 0000000000000..5e87ac17b98fb --- /dev/null +++ b/src/legacy/ui/public/vis/config/index.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { editorConfigProviders } from './editor_config_providers'; +export * from './types'; diff --git a/src/legacy/core_plugins/vis_default_editor/public/config/types.ts b/src/legacy/ui/public/vis/config/types.ts similarity index 100% rename from src/legacy/core_plugins/vis_default_editor/public/config/types.ts rename to src/legacy/ui/public/vis/config/types.ts diff --git a/x-pack/legacy/plugins/rollup/public/visualize/editor_config.js b/x-pack/legacy/plugins/rollup/public/visualize/editor_config.js index 5a1f0755d3a02..8f5072e8a9866 100644 --- a/x-pack/legacy/plugins/rollup/public/visualize/editor_config.js +++ b/x-pack/legacy/plugins/rollup/public/visualize/editor_config.js @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import { editorConfigProviders } from '../../../../../../src/legacy/core_plugins/vis_default_editor/public'; +import { editorConfigProviders } from 'ui/vis/config'; export function initEditorConfig() { // Limit agg params based on rollup capabilities diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 8ac55b4bd124e..ccaccff407c36 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -398,7 +398,6 @@ "charts.colormaps.greysText": "グレー", "charts.colormaps.redsText": "赤", "charts.colormaps.yellowToRedText": "黄色から赤", - "common.ui.visualize.queryGeohashBounds.unableToGetBoundErrorTitle": "バウンドを取得できませんでした", "console.autocomplete.addMethodMetaText": "メソド", "console.consoleDisplayName": "コンソール", "console.consoleMenu.copyAsCurlMessage": "リクエストが URL としてコピーされました", @@ -13202,4 +13201,4 @@ "xpack.watcher.watchEdit.thresholdWatchExpression.aggType.fieldIsRequiredValidationMessage": "フィールドを選択してください。", "xpack.watcher.watcherDescription": "アラートの作成、管理、監視によりデータへの変更を検知します。" } -} \ No newline at end of file +} diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 3c4e6f8c84c5e..4884884b467ca 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -398,7 +398,6 @@ "charts.colormaps.greysText": "灰色", "charts.colormaps.redsText": "红色", "charts.colormaps.yellowToRedText": "黄到红", - "common.ui.visualize.queryGeohashBounds.unableToGetBoundErrorTitle": "无法获取边界", "console.autocomplete.addMethodMetaText": "方法", "console.consoleDisplayName": "控制台", "console.consoleMenu.copyAsCurlMessage": "请求已复制为 cURL", @@ -13201,4 +13200,4 @@ "xpack.watcher.watchEdit.thresholdWatchExpression.aggType.fieldIsRequiredValidationMessage": "此字段必填。", "xpack.watcher.watcherDescription": "通过创建、管理和监测警报来检测数据中的更改。" } -} \ No newline at end of file +}