From dd5c196cf4bab1e647cce178b4bd31ebc634e83d Mon Sep 17 00:00:00 2001 From: Mihir Soni Date: Wed, 10 Mar 2021 19:48:47 -0800 Subject: [PATCH] [Rename] Refactored src/plugins/vis_default_editor directory (#96) Signed-off-by: Mihir Soni --- src/plugins/vis_default_editor/kibana.json | 6 ------ src/plugins/vis_default_editor/opensearch_dashboards.json | 6 ++++++ src/plugins/vis_default_editor/public/components/agg.tsx | 2 +- .../vis_default_editor/public/components/agg_add.tsx | 4 ++-- .../vis_default_editor/public/components/agg_group.tsx | 2 +- .../public/components/agg_params.test.tsx | 6 +++--- .../vis_default_editor/public/components/agg_params.tsx | 8 ++++---- .../vis_default_editor/public/components/agg_select.tsx | 8 ++++---- .../public/components/controls/auto_precision.tsx | 2 +- .../components/controls/components/from_to_list.tsx | 2 +- .../public/components/controls/components/input_list.tsx | 2 +- .../public/components/controls/components/mask_list.tsx | 2 +- .../controls/components/number_list/number_list.tsx | 2 +- .../controls/components/number_list/number_row.tsx | 2 +- .../components/controls/components/number_list/utils.ts | 2 +- .../components/controls/components/simple_number_list.tsx | 2 +- .../public/components/controls/date_ranges.test.tsx | 6 +++--- .../public/components/controls/date_ranges.tsx | 8 ++++---- .../public/components/controls/drop_partials.tsx | 2 +- .../public/components/controls/extended_bounds.tsx | 2 +- .../public/components/controls/field.tsx | 2 +- .../public/components/controls/filter.tsx | 6 +++--- .../public/components/controls/filters.tsx | 6 +++--- .../public/components/controls/has_extended_bounds.tsx | 2 +- .../public/components/controls/ip_range_type.tsx | 2 +- .../public/components/controls/is_filtered_by_collar.tsx | 2 +- .../public/components/controls/max_bars.tsx | 8 ++++---- .../public/components/controls/metric_agg.tsx | 2 +- .../public/components/controls/min_doc_count.tsx | 2 +- .../public/components/controls/missing_bucket.tsx | 4 ++-- .../public/components/controls/number_interval.tsx | 4 ++-- .../public/components/controls/order.tsx | 2 +- .../public/components/controls/order_by.tsx | 2 +- .../public/components/controls/other_bucket.tsx | 2 +- .../public/components/controls/percentile_ranks.tsx | 2 +- .../public/components/controls/percentiles.tsx | 2 +- .../public/components/controls/precision.tsx | 6 +++--- .../public/components/controls/radius_ratio_option.tsx | 4 ++-- .../public/components/controls/ranges.tsx | 4 ++-- .../public/components/controls/raw_json.tsx | 4 ++-- .../public/components/controls/rows_or_columns.tsx | 2 +- .../public/components/controls/scale_metrics.tsx | 2 +- .../public/components/controls/size.tsx | 2 +- .../public/components/controls/sub_metric.tsx | 2 +- .../public/components/controls/time_interval.tsx | 8 ++++---- .../public/components/controls/top_aggregate.tsx | 4 ++-- .../public/components/controls/top_field.tsx | 2 +- .../public/components/controls/top_size.tsx | 2 +- .../public/components/controls/top_sort_field.tsx | 2 +- .../public/components/controls/use_geocentroid.tsx | 2 +- .../public/components/controls/utils/agg_utils.ts | 2 +- .../public/components/sidebar/controls.tsx | 4 ++-- .../public/components/sidebar/sidebar.tsx | 2 +- .../public/components/sidebar/sidebar_title.tsx | 8 ++++---- .../public/components/sidebar/state/index.ts | 6 +++--- .../public/components/sidebar/use_option_tabs.ts | 2 +- .../public/components/utils/editor_config.ts | 2 +- src/plugins/vis_default_editor/public/default_editor.tsx | 8 ++++---- src/plugins/vis_default_editor/public/schemas.ts | 2 +- src/plugins/vis_default_editor/public/types.ts | 2 +- 60 files changed, 105 insertions(+), 105 deletions(-) delete mode 100644 src/plugins/vis_default_editor/kibana.json create mode 100644 src/plugins/vis_default_editor/opensearch_dashboards.json diff --git a/src/plugins/vis_default_editor/kibana.json b/src/plugins/vis_default_editor/kibana.json deleted file mode 100644 index 35ad0a3a8be9..000000000000 --- a/src/plugins/vis_default_editor/kibana.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": "visDefaultEditor", - "version": "kibana", - "ui": true, - "requiredBundles": ["kibanaUtils", "kibanaReact", "data"] -} diff --git a/src/plugins/vis_default_editor/opensearch_dashboards.json b/src/plugins/vis_default_editor/opensearch_dashboards.json new file mode 100644 index 000000000000..e3fe553406ba --- /dev/null +++ b/src/plugins/vis_default_editor/opensearch_dashboards.json @@ -0,0 +1,6 @@ +{ + "id": "visDefaultEditor", + "version": "opensearchDashboards", + "ui": true, + "requiredBundles": ["opensearchDashboardsUtils", "opensearchDashboardsReact", "data"] +} diff --git a/src/plugins/vis_default_editor/public/components/agg.tsx b/src/plugins/vis_default_editor/public/components/agg.tsx index 76c8e0dc0cb9..b441573c2eb5 100644 --- a/src/plugins/vis_default_editor/public/components/agg.tsx +++ b/src/plugins/vis_default_editor/public/components/agg.tsx @@ -26,7 +26,7 @@ import { EuiSpacer, EuiIconTip, } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { IAggConfig, TimeRange } from 'src/plugins/data/public'; import { DefaultEditorAggParams } from './agg_params'; diff --git a/src/plugins/vis_default_editor/public/components/agg_add.tsx b/src/plugins/vis_default_editor/public/components/agg_add.tsx index 46d5af8cec68..77ba9214ce54 100644 --- a/src/plugins/vis_default_editor/public/components/agg_add.tsx +++ b/src/plugins/vis_default_editor/public/components/agg_add.tsx @@ -27,8 +27,8 @@ import { EuiPopover, EuiPopoverTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; +import { i18n } from '@osd/i18n'; import { IAggConfig, AggGroupNames } from '../../../data/public'; import { Schema } from '../schemas'; diff --git a/src/plugins/vis_default_editor/public/components/agg_group.tsx b/src/plugins/vis_default_editor/public/components/agg_group.tsx index 4cde33b8fbc3..8854ea011478 100644 --- a/src/plugins/vis_default_editor/public/components/agg_group.tsx +++ b/src/plugins/vis_default_editor/public/components/agg_group.tsx @@ -28,7 +28,7 @@ import { EuiPanel, EuiFormErrorText, } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { AggGroupNames, AggGroupLabels, IAggConfig, TimeRange } from '../../../data/public'; import { DefaultEditorAgg } from './agg'; diff --git a/src/plugins/vis_default_editor/public/components/agg_params.test.tsx b/src/plugins/vis_default_editor/public/components/agg_params.test.tsx index cac1b0851b92..261e956d62cf 100644 --- a/src/plugins/vis_default_editor/public/components/agg_params.test.tsx +++ b/src/plugins/vis_default_editor/public/components/agg_params.test.tsx @@ -25,7 +25,7 @@ import { DefaultEditorAggParams as PureDefaultEditorAggParams, DefaultEditorAggParamsProps, } from './agg_params'; -import { KibanaContextProvider } from '../../../kibana_react/public'; +import { OpenSearchDashboardsContextProvider } from '../../../opensearch_dashboards_react/public'; import { dataPluginMock } from '../../../data/public/mocks'; import { EditorVisState } from './sidebar/state/reducers'; @@ -39,9 +39,9 @@ const mockEditorConfig = { }, }; const DefaultEditorAggParams = (props: DefaultEditorAggParamsProps) => ( - + - + ); jest.mock('./utils', () => ({ diff --git a/src/plugins/vis_default_editor/public/components/agg_params.tsx b/src/plugins/vis_default_editor/public/components/agg_params.tsx index 78398d8359e9..a4dfaa87a72a 100644 --- a/src/plugins/vis_default_editor/public/components/agg_params.tsx +++ b/src/plugins/vis_default_editor/public/components/agg_params.tsx @@ -19,7 +19,7 @@ import React, { useCallback, useReducer, useEffect, useMemo } from 'react'; import { EuiForm, EuiAccordion, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import useUnmount from 'react-use/lib/useUnmount'; import { IAggConfig, IndexPattern, AggGroupNames } from '../../../data/public'; @@ -40,8 +40,8 @@ import { import { DefaultEditorCommonProps } from './agg_common_props'; import { EditorParamConfig, TimeIntervalParam, FixedParam, getEditorConfig } from './utils'; import { Schema, getSchemaByName } from '../schemas'; -import { useKibana } from '../../../kibana_react/public'; -import { VisDefaultEditorKibanaServices } from '../types'; +import { useOpenSearchDashboards } from '../../../opensearch_dashboards_react/public'; +import { VisDefaultEditorOpenSearchDashboardsServices } from '../types'; const FIXED_VALUE_PROP = 'fixedValue'; const DEFAULT_PROP = 'default'; @@ -89,7 +89,7 @@ function DefaultEditorAggParams({ allowedAggs, schema.aggFilter, ]); - const { services } = useKibana(); + const { services } = useOpenSearchDashboards(); const aggTypes = useMemo(() => services.data.search.aggs.types.getAll(), [ services.data.search.aggs.types, ]); diff --git a/src/plugins/vis_default_editor/public/components/agg_select.tsx b/src/plugins/vis_default_editor/public/components/agg_select.tsx index cccfb043cf0a..80b789165f25 100644 --- a/src/plugins/vis_default_editor/public/components/agg_select.tsx +++ b/src/plugins/vis_default_editor/public/components/agg_select.tsx @@ -20,12 +20,12 @@ import { get, has } from 'lodash'; import React, { useEffect, useCallback, useState } from 'react'; import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow, EuiLink, EuiText } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@osd/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; import { IAggType, IndexPattern } from 'src/plugins/data/public'; import { DocLinksStart } from '../../../../core/public'; -import { useKibana } from '../../../kibana_react/public'; +import { useOpenSearchDashboards } from '../../../opensearch_dashboards_react/public'; import { ComboBoxGroupedOptions } from '../utils'; import { AGG_TYPE_ACTION_KEYS, AggTypeAction } from './agg_params_state'; @@ -53,7 +53,7 @@ function DefaultEditorAggSelect({ onChangeAggType, }: DefaultEditorAggSelectProps) { const [isDirty, setIsDirty] = useState(false); - const { services } = useKibana<{ docLinks: DocLinksStart }>(); + const { services } = useOpenSearchDashboards<{ docLinks: DocLinksStart }>(); const selectedOptions: ComboBoxGroupedOptions = value ? [{ label: value.title, target: value }] : []; diff --git a/src/plugins/vis_default_editor/public/components/controls/auto_precision.tsx b/src/plugins/vis_default_editor/public/components/controls/auto_precision.tsx index 11b249e1873a..e5107f6b7235 100644 --- a/src/plugins/vis_default_editor/public/components/controls/auto_precision.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/auto_precision.tsx @@ -20,7 +20,7 @@ import React from 'react'; import { EuiSwitch, EuiFormRow } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { AggParamEditorProps } from '../agg_param_props'; function AutoPrecisionParamEditor({ value = false, setValue }: AggParamEditorProps) { diff --git a/src/plugins/vis_default_editor/public/components/controls/components/from_to_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/from_to_list.tsx index c0c46f6714c2..ad1257fef7d4 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/from_to_list.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/from_to_list.tsx @@ -19,7 +19,7 @@ import React, { useCallback } from 'react'; import { EuiFieldText, EuiFlexItem, EuiIcon } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { search } from '../../../../../data/public'; import { InputList, InputListConfig, InputModel, InputObject, InputItem } from './input_list'; diff --git a/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx index 37e95f2419b4..410cb9c8c177 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx @@ -27,7 +27,7 @@ import { htmlIdGenerator, EuiButtonEmpty, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@osd/i18n/react'; export interface InputListConfig { defaultValue: InputItemModel; diff --git a/src/plugins/vis_default_editor/public/components/controls/components/mask_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/mask_list.tsx index 98f92387e003..a6d7c6247a94 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/mask_list.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/mask_list.tsx @@ -19,7 +19,7 @@ import React, { useCallback } from 'react'; import { EuiFieldText, EuiFlexItem } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { InputList, InputListConfig, InputObject, InputModel, InputItem } from './input_list'; import { search } from '../../../../../data/public'; diff --git a/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.tsx index aac4c9fe528b..f267abf46732 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.tsx @@ -20,7 +20,7 @@ import React, { Fragment, useState, useEffect, useMemo, useCallback } from 'react'; import { EuiSpacer, EuiButtonEmpty, EuiFlexItem, EuiFormErrorText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@osd/i18n/react'; import { NumberRow, NumberRowModel } from './number_row'; import { parse, diff --git a/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_row.tsx b/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_row.tsx index 6101cce182d4..4aca924a3e1f 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_row.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_row.tsx @@ -20,7 +20,7 @@ import React, { useCallback } from 'react'; import { EuiFieldNumber, EuiFlexGroup, EuiFlexItem, EuiButtonIcon } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { NumberListRange } from './range'; export interface NumberRowProps { diff --git a/src/plugins/vis_default_editor/public/components/controls/components/number_list/utils.ts b/src/plugins/vis_default_editor/public/components/controls/components/number_list/utils.ts index a3998cbd5954..9fe853a300d8 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/number_list/utils.ts +++ b/src/plugins/vis_default_editor/public/components/controls/components/number_list/utils.ts @@ -18,7 +18,7 @@ */ import { last } from 'lodash'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { htmlIdGenerator } from '@elastic/eui'; import { parseRange, NumberListRange } from './range'; diff --git a/src/plugins/vis_default_editor/public/components/controls/components/simple_number_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/simple_number_list.tsx index 079fa95d362a..e11f303429f5 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/simple_number_list.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/simple_number_list.tsx @@ -20,7 +20,7 @@ import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react'; import { isArray } from 'lodash'; import { EuiButtonEmpty, EuiFlexItem, EuiFormRow, EuiSpacer, htmlIdGenerator } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@osd/i18n/react'; import { EMPTY_STRING, getInitModelList, getRange, parse } from './number_list/utils'; import { NumberRow, NumberRowModel } from './number_list/number_row'; import { AggParamEditorProps } from '../../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/date_ranges.test.tsx b/src/plugins/vis_default_editor/public/components/controls/date_ranges.test.tsx index 5c95d72bcd28..d56c34d8d980 100644 --- a/src/plugins/vis_default_editor/public/components/controls/date_ranges.test.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/date_ranges.test.tsx @@ -20,7 +20,7 @@ import React from 'react'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; import { DateRangesParamEditor } from './date_ranges'; -import { KibanaContextProvider } from '../../../../kibana_react/public'; +import { OpenSearchDashboardsContextProvider } from '../../../../opensearch_dashboards_react/public'; import { docLinksServiceMock } from '../../../../../core/public/mocks'; describe('DateRangesParamEditor component', () => { @@ -53,9 +53,9 @@ describe('DateRangesParamEditor component', () => { docLinks: docLinksServiceMock.createStartContract(), }; return ( - + - + ); } diff --git a/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx b/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx index 4afc85ba3b5c..22817b252114 100644 --- a/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx @@ -33,13 +33,13 @@ import { EuiFormRow, } from '@elastic/eui'; import dateMath from '@elastic/datemath'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; +import { i18n } from '@osd/i18n'; import { isEqual, omit } from 'lodash'; import { useMount } from 'react-use'; import { DocLinksStart } from 'src/core/public'; -import { useKibana } from '../../../../kibana_react/public'; +import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public'; import { AggParamEditorProps } from '../agg_param_props'; const FROM_PLACEHOLDER = '\u2212\u221E'; @@ -68,7 +68,7 @@ function DateRangesParamEditor({ setValue, setValidity, }: AggParamEditorProps) { - const { services } = useKibana<{ docLinks: DocLinksStart }>(); + const { services } = useOpenSearchDashboards<{ docLinks: DocLinksStart }>(); const [ranges, setRanges] = useState(() => value.map((range) => ({ ...range, id: generateId() })) ); diff --git a/src/plugins/vis_default_editor/public/components/controls/drop_partials.tsx b/src/plugins/vis_default_editor/public/components/controls/drop_partials.tsx index b112598d1a09..8fca6dd9e722 100644 --- a/src/plugins/vis_default_editor/public/components/controls/drop_partials.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/drop_partials.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { SwitchParamEditor } from './switch'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/extended_bounds.tsx b/src/plugins/vis_default_editor/public/components/controls/extended_bounds.tsx index 11df63c9a3fa..e74364e4e8e2 100644 --- a/src/plugins/vis_default_editor/public/components/controls/extended_bounds.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/extended_bounds.tsx @@ -20,7 +20,7 @@ import React, { ChangeEvent } from 'react'; import { EuiFieldNumber, EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { isUndefined } from 'lodash'; import { useValidation } from './utils'; diff --git a/src/plugins/vis_default_editor/public/components/controls/field.tsx b/src/plugins/vis_default_editor/public/components/controls/field.tsx index bfc4f881f845..f69049d0fb77 100644 --- a/src/plugins/vis_default_editor/public/components/controls/field.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/field.tsx @@ -22,7 +22,7 @@ import React, { useState, useCallback } from 'react'; import { useMount } from 'react-use'; import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { AggParam, IAggConfig, IFieldParamType, IndexPatternField } from 'src/plugins/data/public'; import { formatListAsProse, parseCommaSeparatedList, useValidation } from './utils'; diff --git a/src/plugins/vis_default_editor/public/components/controls/filter.tsx b/src/plugins/vis_default_editor/public/components/controls/filter.tsx index c373f9331c9a..23c7be6fe53f 100644 --- a/src/plugins/vis_default_editor/public/components/controls/filter.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/filter.tsx @@ -19,7 +19,7 @@ import React, { useState } from 'react'; import { EuiForm, EuiButtonIcon, EuiFieldText, EuiFormRow, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { IAggConfig, @@ -27,7 +27,7 @@ import { QueryStringInput, DataPublicPluginStart, } from '../../../../data/public'; -import { useKibana } from '../../../../kibana_react/public'; +import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public'; interface FilterRowProps { id: string; @@ -54,7 +54,7 @@ function FilterRow({ onChangeValue, onRemoveFilter, }: FilterRowProps) { - const { services } = useKibana<{ data: DataPublicPluginStart; appName: string }>(); + const { services } = useOpenSearchDashboards<{ data: DataPublicPluginStart; appName: string }>(); const [showCustomLabel, setShowCustomLabel] = useState(false); const filterLabel = i18n.translate('visDefaultEditor.controls.filters.filterLabel', { defaultMessage: 'Filter {index}', diff --git a/src/plugins/vis_default_editor/public/components/controls/filters.tsx b/src/plugins/vis_default_editor/public/components/controls/filters.tsx index b2e6373edfc1..07f8dbb79b7e 100644 --- a/src/plugins/vis_default_editor/public/components/controls/filters.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/filters.tsx @@ -20,12 +20,12 @@ import React, { useState, useEffect } from 'react'; import { omit, isEqual } from 'lodash'; import { htmlIdGenerator, EuiButton, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@osd/i18n/react'; import { useMount } from 'react-use'; import { Query, DataPublicPluginStart } from '../../../../data/public'; import { IUiSettingsClient } from '../../../../../core/public'; -import { useKibana } from '../../../../kibana_react/public'; +import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public'; import { FilterRow } from './filter'; import { AggParamEditorProps } from '../agg_param_props'; @@ -65,7 +65,7 @@ function FiltersParamEditor({ agg, value = [], setValue }: AggParamEditorProps(); + const { services } = useOpenSearchDashboards<{ uiSettings: IUiSettingsClient; data: DataPublicPluginStart }>(); const onAddFilter = () => updateFilters([ diff --git a/src/plugins/vis_default_editor/public/components/controls/has_extended_bounds.tsx b/src/plugins/vis_default_editor/public/components/controls/has_extended_bounds.tsx index ae3da8e203a5..5669cb859841 100644 --- a/src/plugins/vis_default_editor/public/components/controls/has_extended_bounds.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/has_extended_bounds.tsx @@ -18,7 +18,7 @@ */ import React, { useEffect, useRef } from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { search } from '../../../../data/public'; import { SwitchParamEditor } from './switch'; diff --git a/src/plugins/vis_default_editor/public/components/controls/ip_range_type.tsx b/src/plugins/vis_default_editor/public/components/controls/ip_range_type.tsx index 4176dfaf2689..2af01d694c32 100644 --- a/src/plugins/vis_default_editor/public/components/controls/ip_range_type.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/ip_range_type.tsx @@ -20,7 +20,7 @@ import React from 'react'; import { EuiButtonGroup, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/is_filtered_by_collar.tsx b/src/plugins/vis_default_editor/public/components/controls/is_filtered_by_collar.tsx index 5a71f5c3a2fc..abffababb491 100644 --- a/src/plugins/vis_default_editor/public/components/controls/is_filtered_by_collar.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/is_filtered_by_collar.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { SwitchParamEditor } from './switch'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/max_bars.tsx b/src/plugins/vis_default_editor/public/components/controls/max_bars.tsx index b0d517e0928d..36123c3c4068 100644 --- a/src/plugins/vis_default_editor/public/components/controls/max_bars.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/max_bars.tsx @@ -19,9 +19,9 @@ import React, { useCallback, useEffect } from 'react'; import { EuiFormRow, EuiFieldNumber, EuiFieldNumberProps, EuiIconTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; -import { useKibana } from '../../../../kibana_react/public'; +import { FormattedMessage } from '@osd/i18n/react'; +import { i18n } from '@osd/i18n'; +import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public'; import { AggParamEditorProps } from '../agg_param_props'; import { UI_SETTINGS } from '../../../../data/public'; @@ -63,7 +63,7 @@ function MaxBarsParamEditor({ setValidity, setTouched, }: SizeParamEditorProps) { - const { services } = useKibana(); + const { services } = useOpenSearchDashboards(); const uiSettingMaxBars = services.uiSettings?.get(UI_SETTINGS.HISTOGRAM_MAX_BARS); const isValid = disabled || diff --git a/src/plugins/vis_default_editor/public/components/controls/metric_agg.tsx b/src/plugins/vis_default_editor/public/components/controls/metric_agg.tsx index 7215ef3dcc7b..c34b2f9ada3f 100644 --- a/src/plugins/vis_default_editor/public/components/controls/metric_agg.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/metric_agg.tsx @@ -19,7 +19,7 @@ import React, { useMemo, useCallback } from 'react'; import { EuiFormRow, EuiSelect } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { useAvailableOptions, useFallbackMetric, useValidation } from './utils'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/min_doc_count.tsx b/src/plugins/vis_default_editor/public/components/controls/min_doc_count.tsx index 06b8908d9589..16c0937ed633 100644 --- a/src/plugins/vis_default_editor/public/components/controls/min_doc_count.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/min_doc_count.tsx @@ -19,7 +19,7 @@ import React from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { SwitchParamEditor } from './switch'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/missing_bucket.tsx b/src/plugins/vis_default_editor/public/components/controls/missing_bucket.tsx index 7d4d2230bd76..d2861384959e 100644 --- a/src/plugins/vis_default_editor/public/components/controls/missing_bucket.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/missing_bucket.tsx @@ -18,7 +18,7 @@ */ import React, { useEffect } from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { SwitchParamEditor } from './switch'; import { search } from '../../../../data/public'; @@ -48,7 +48,7 @@ function MissingBucketParamEditor(props: AggParamEditorProps) { 'Only works for fields of type "string". When enabled, include documents with missing ' + 'values in the search. If this bucket is in the top N, it appears in the chart. ' + 'If not in the top N, and you enable "Group other values in separate bucket", ' + - 'Elasticsearch adds the missing values to the "other" bucket.', + 'OpenSearch adds the missing values to the "other" bucket.', } )} disabled={fieldTypeIsNotString} diff --git a/src/plugins/vis_default_editor/public/components/controls/number_interval.tsx b/src/plugins/vis_default_editor/public/components/controls/number_interval.tsx index 8cdc92581cef..4913766126a7 100644 --- a/src/plugins/vis_default_editor/public/components/controls/number_interval.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/number_interval.tsx @@ -30,8 +30,8 @@ import { EuiFlexGroup, EuiFlexItem, } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@osd/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; import { UI_SETTINGS } from '../../../../data/public'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/order.tsx b/src/plugins/vis_default_editor/public/components/controls/order.tsx index 9f7c39eb65dc..4988628544a6 100644 --- a/src/plugins/vis_default_editor/public/components/controls/order.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/order.tsx @@ -19,7 +19,7 @@ import React, { useEffect } from 'react'; import { EuiFormRow, EuiSelect } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { OptionedValueProp } from 'src/plugins/data/public'; import { AggParamEditorProps, OptionedParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/order_by.tsx b/src/plugins/vis_default_editor/public/components/controls/order_by.tsx index 30a72818fe8a..c2455cebee99 100644 --- a/src/plugins/vis_default_editor/public/components/controls/order_by.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/order_by.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { EuiFormRow, EuiSelect } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { useMount } from 'react-use'; import { diff --git a/src/plugins/vis_default_editor/public/components/controls/other_bucket.tsx b/src/plugins/vis_default_editor/public/components/controls/other_bucket.tsx index 055fa76e8b28..0ccd3183b554 100644 --- a/src/plugins/vis_default_editor/public/components/controls/other_bucket.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/other_bucket.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { SwitchParamEditor } from './switch'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/percentile_ranks.tsx b/src/plugins/vis_default_editor/public/components/controls/percentile_ranks.tsx index fb7d8d78b28e..a62f6cb5b6f6 100644 --- a/src/plugins/vis_default_editor/public/components/controls/percentile_ranks.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/percentile_ranks.tsx @@ -19,7 +19,7 @@ import React, { useState, useCallback } from 'react'; import { EuiFormRow } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { NumberList } from './components/number_list'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/percentiles.tsx b/src/plugins/vis_default_editor/public/components/controls/percentiles.tsx index 9f1f26fe5446..28f80a1053d7 100644 --- a/src/plugins/vis_default_editor/public/components/controls/percentiles.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/percentiles.tsx @@ -19,7 +19,7 @@ import React, { useState, useCallback } from 'react'; import { EuiFormRow } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { NumberList } from './components/number_list'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/precision.tsx b/src/plugins/vis_default_editor/public/components/controls/precision.tsx index 1826c0ac4b9e..3dfdaec2060e 100644 --- a/src/plugins/vis_default_editor/public/components/controls/precision.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/precision.tsx @@ -20,14 +20,14 @@ import React from 'react'; import { EuiRange, EuiFormRow } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { IUiSettingsClient } from '../../../../../core/public'; -import { useKibana } from '../../../../kibana_react/public'; +import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public'; import { AggParamEditorProps } from '../agg_param_props'; function PrecisionParamEditor({ agg, value, setValue }: AggParamEditorProps) { - const { services } = useKibana<{ uiSettings: IUiSettingsClient }>(); + const { services } = useOpenSearchDashboards<{ uiSettings: IUiSettingsClient }>(); const label = i18n.translate('visDefaultEditor.controls.precisionLabel', { defaultMessage: 'Precision', }); diff --git a/src/plugins/vis_default_editor/public/components/controls/radius_ratio_option.tsx b/src/plugins/vis_default_editor/public/components/controls/radius_ratio_option.tsx index 86c4431b6d5e..503f2b181574 100644 --- a/src/plugins/vis_default_editor/public/components/controls/radius_ratio_option.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/radius_ratio_option.tsx @@ -19,8 +19,8 @@ import React, { useCallback } from 'react'; import { EuiFormRow, EuiIconTip, EuiRange, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@osd/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; import { useMount } from 'react-use'; import { AggControlProps } from './agg_control_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/ranges.tsx b/src/plugins/vis_default_editor/public/components/controls/ranges.tsx index e5f5b53a3d87..96952ff1fec6 100644 --- a/src/plugins/vis_default_editor/public/components/controls/ranges.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/ranges.tsx @@ -32,8 +32,8 @@ import { EuiToolTip, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; +import { i18n } from '@osd/i18n'; import { isEqual, omit } from 'lodash'; const FROM_PLACEHOLDER = '\u2212\u221E'; diff --git a/src/plugins/vis_default_editor/public/components/controls/raw_json.tsx b/src/plugins/vis_default_editor/public/components/controls/raw_json.tsx index 03a09927ecb7..2e099a053770 100644 --- a/src/plugins/vis_default_editor/public/components/controls/raw_json.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/raw_json.tsx @@ -22,7 +22,7 @@ import 'brace/mode/json'; import React, { useState, useMemo, useCallback } from 'react'; import { EuiFormRow, EuiIconTip, EuiCodeEditor, EuiScreenReaderOnly } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { AggParamEditorProps } from '../agg_param_props'; @@ -42,7 +42,7 @@ function RawJsonParamEditor({ () => i18n.translate('visDefaultEditor.controls.jsonInputTooltip', { defaultMessage: - "Any JSON formatted properties you add here will be merged with the elasticsearch aggregation definition for this section. For example 'shard_size' on a terms aggregation.", + "Any JSON formatted properties you add here will be merged with the opensearch aggregation definition for this section. For example 'shard_size' on a terms aggregation.", }), [] ); diff --git a/src/plugins/vis_default_editor/public/components/controls/rows_or_columns.tsx b/src/plugins/vis_default_editor/public/components/controls/rows_or_columns.tsx index 4e06e8d0af71..23d2953efc23 100644 --- a/src/plugins/vis_default_editor/public/components/controls/rows_or_columns.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/rows_or_columns.tsx @@ -19,7 +19,7 @@ import React, { useCallback } from 'react'; import { EuiButtonGroup, EuiFormRow, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { AggControlProps } from './agg_control_props'; const PARAMS = { diff --git a/src/plugins/vis_default_editor/public/components/controls/scale_metrics.tsx b/src/plugins/vis_default_editor/public/components/controls/scale_metrics.tsx index 944cbf3b32c6..86008e292944 100644 --- a/src/plugins/vis_default_editor/public/components/controls/scale_metrics.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/scale_metrics.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { SwitchParamEditor } from './switch'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/size.tsx b/src/plugins/vis_default_editor/public/components/controls/size.tsx index 159607cbdbd5..9d052961b7a6 100644 --- a/src/plugins/vis_default_editor/public/components/controls/size.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/size.tsx @@ -20,7 +20,7 @@ import React, { useEffect } from 'react'; import { isUndefined } from 'lodash'; import { EuiFormRow, EuiFieldNumber } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@osd/i18n/react'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/sub_metric.tsx b/src/plugins/vis_default_editor/public/components/controls/sub_metric.tsx index fc79ba703c2b..d0943bbb0ec5 100644 --- a/src/plugins/vis_default_editor/public/components/controls/sub_metric.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/sub_metric.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { EuiFormLabel, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { useMount } from 'react-use'; import { AggParamType, IAggConfig, AggGroupNames } from '../../../../data/public'; diff --git a/src/plugins/vis_default_editor/public/components/controls/time_interval.tsx b/src/plugins/vis_default_editor/public/components/controls/time_interval.tsx index dd9e432fa512..569f57a5ce4d 100644 --- a/src/plugins/vis_default_editor/public/components/controls/time_interval.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/time_interval.tsx @@ -20,14 +20,14 @@ import { get, find } from 'lodash'; import React, { useEffect } from 'react'; import { EuiFormRow, EuiIconTip, EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@osd/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; import { search, AggParamOption } from '../../../../data/public'; import { AggParamEditorProps } from '../agg_param_props'; const { parseEsInterval, InvalidEsCalendarIntervalError } = search.aggs; -// we check if Elasticsearch interval is valid to show a user appropriate error message +// we check if OpenSearch interval is valid to show a user appropriate error message // e.g. there is the case when a user inputs '14d' but it's '2w' in expression equivalent and the request will fail // we don't check it for 0ms because the overall time range has not yet been set function isValidCalendarInterval(interval: string) { @@ -69,7 +69,7 @@ function validateInterval( } if (!timeBase) { - // we check if Elasticsearch interval is valid ES interval to show a user appropriate error message + // we check if OpenSearch interval is valid OpenSearch interval to show a user appropriate error message // we don't check if there is timeBase const { isValidCalendarValue, error } = isValidCalendarInterval(value); if (!isValidCalendarValue) { diff --git a/src/plugins/vis_default_editor/public/components/controls/top_aggregate.tsx b/src/plugins/vis_default_editor/public/components/controls/top_aggregate.tsx index 1ef3f1b49ae0..ef9ed81d01a1 100644 --- a/src/plugins/vis_default_editor/public/components/controls/top_aggregate.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/top_aggregate.tsx @@ -19,8 +19,8 @@ import React, { useEffect, useRef } from 'react'; import { EuiFormRow, EuiIconTip, EuiSelect } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@osd/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; import { IAggConfig, diff --git a/src/plugins/vis_default_editor/public/components/controls/top_field.tsx b/src/plugins/vis_default_editor/public/components/controls/top_field.tsx index f625fe3c75c8..88ddfb8d8c0a 100644 --- a/src/plugins/vis_default_editor/public/components/controls/top_field.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/top_field.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { IndexPatternField } from 'src/plugins/data/public'; import { FieldParamEditor } from './field'; diff --git a/src/plugins/vis_default_editor/public/components/controls/top_size.tsx b/src/plugins/vis_default_editor/public/components/controls/top_size.tsx index 6d237f73aadb..4c4b5c2f050c 100644 --- a/src/plugins/vis_default_editor/public/components/controls/top_size.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/top_size.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { EuiIconTip } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { SizeParamEditor } from './size'; import { getCompatibleAggs } from './top_aggregate'; diff --git a/src/plugins/vis_default_editor/public/components/controls/top_sort_field.tsx b/src/plugins/vis_default_editor/public/components/controls/top_sort_field.tsx index 1e5a4e187f19..30cf82b93432 100644 --- a/src/plugins/vis_default_editor/public/components/controls/top_sort_field.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/top_sort_field.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { IndexPatternField } from 'src/plugins/data/public'; import { FieldParamEditor } from './field'; diff --git a/src/plugins/vis_default_editor/public/components/controls/use_geocentroid.tsx b/src/plugins/vis_default_editor/public/components/controls/use_geocentroid.tsx index 02c348092826..6f257cc61c78 100644 --- a/src/plugins/vis_default_editor/public/components/controls/use_geocentroid.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/use_geocentroid.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { EuiSwitch, EuiFormRow } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { AggParamEditorProps } from '../agg_param_props'; function UseGeocentroidParamEditor({ value = false, setValue }: AggParamEditorProps) { diff --git a/src/plugins/vis_default_editor/public/components/controls/utils/agg_utils.ts b/src/plugins/vis_default_editor/public/components/controls/utils/agg_utils.ts index 950c85634923..16f2e3a2be7d 100644 --- a/src/plugins/vis_default_editor/public/components/controls/utils/agg_utils.ts +++ b/src/plugins/vis_default_editor/public/components/controls/utils/agg_utils.ts @@ -18,7 +18,7 @@ */ import { useEffect, useCallback, useMemo } from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { IAggConfig } from 'src/plugins/data/public'; diff --git a/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx b/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx index 2e4fcb4fa35a..ba2c6586919d 100644 --- a/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx +++ b/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx @@ -26,8 +26,8 @@ import { EuiButtonToggle, EuiToolTip, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; +import { i18n } from '@osd/i18n'; import { useDebounce } from 'react-use'; import { Vis } from 'src/plugins/visualizations/public'; diff --git a/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx b/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx index d6b69a769e0a..eebd839d80d5 100644 --- a/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx +++ b/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx @@ -19,7 +19,7 @@ import React, { useMemo, useState, useCallback, KeyboardEventHandler, useEffect } from 'react'; import { isEqual } from 'lodash'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { keys, EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { EventEmitter } from 'events'; diff --git a/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx b/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx index 4889e6ca049c..c02d8e026554 100644 --- a/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx +++ b/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx @@ -32,13 +32,13 @@ import { EuiTitle, EuiToolTip, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@osd/i18n/react'; +import { i18n } from '@osd/i18n'; import { Vis } from 'src/plugins/visualizations/public'; import { SavedObject } from 'src/plugins/saved_objects/public'; import { ApplicationStart } from '../../../../../core/public'; -import { useKibana } from '../../../../kibana_react/public'; +import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public'; interface LinkedSearchProps { savedSearch: SavedObject; @@ -56,7 +56,7 @@ export function LinkedSearch({ savedSearch, eventEmitter }: LinkedSearchProps) { const [showPopover, setShowPopover] = useState(false); const { services: { application }, - } = useKibana<{ application: ApplicationStart }>(); + } = useOpenSearchDashboards<{ application: ApplicationStart }>(); const closePopover = useCallback(() => setShowPopover(false), []); const onClickButtonLink = useCallback(() => setShowPopover((v) => !v), []); diff --git a/src/plugins/vis_default_editor/public/components/sidebar/state/index.ts b/src/plugins/vis_default_editor/public/components/sidebar/state/index.ts index 1bfa100cbd0f..f7be4bb1e1fa 100644 --- a/src/plugins/vis_default_editor/public/components/sidebar/state/index.ts +++ b/src/plugins/vis_default_editor/public/components/sidebar/state/index.ts @@ -24,8 +24,8 @@ import { Vis } from 'src/plugins/visualizations/public'; import { createEditorStateReducer, initEditorState, EditorVisState } from './reducers'; import { EditorStateActionTypes } from './constants'; import { EditorAction } from './actions'; -import { useKibana } from '../../../../../kibana_react/public'; -import { VisDefaultEditorKibanaServices } from '../../../types'; +import { useOpenSearchDashboards } from '../../../../../opensearch_dashboards_react/public'; +import { VisDefaultEditorOpenSearchDashboardsServices } from '../../../types'; export * from './editor_form_state'; export * from './actions'; @@ -34,7 +34,7 @@ export function useEditorReducer( vis: Vis, eventEmitter: EventEmitter ): [EditorVisState, React.Dispatch] { - const { services } = useKibana(); + const { services } = useOpenSearchDashboards(); const [state, dispatch] = useReducer( createEditorStateReducer(services.data.search), vis, diff --git a/src/plugins/vis_default_editor/public/components/sidebar/use_option_tabs.ts b/src/plugins/vis_default_editor/public/components/sidebar/use_option_tabs.ts index 337533df50fa..e134b6404089 100644 --- a/src/plugins/vis_default_editor/public/components/sidebar/use_option_tabs.ts +++ b/src/plugins/vis_default_editor/public/components/sidebar/use_option_tabs.ts @@ -18,7 +18,7 @@ */ import { useCallback, useState } from 'react'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { Vis } from 'src/plugins/visualizations/public'; import { DefaultEditorDataTab, DefaultEditorDataTabProps } from './data_tab'; diff --git a/src/plugins/vis_default_editor/public/components/utils/editor_config.ts b/src/plugins/vis_default_editor/public/components/utils/editor_config.ts index 80a64b7289f8..6b7b719c55df 100644 --- a/src/plugins/vis_default_editor/public/components/utils/editor_config.ts +++ b/src/plugins/vis_default_editor/public/components/utils/editor_config.ts @@ -17,7 +17,7 @@ * under the License. */ -import { i18n } from '@kbn/i18n'; +import { i18n } from '@osd/i18n'; import { IndexPattern } from 'src/plugins/data/public'; /** diff --git a/src/plugins/vis_default_editor/public/default_editor.tsx b/src/plugins/vis_default_editor/public/default_editor.tsx index a7251acfdf75..40740741f75e 100644 --- a/src/plugins/vis_default_editor/public/default_editor.tsx +++ b/src/plugins/vis_default_editor/public/default_editor.tsx @@ -25,8 +25,8 @@ import { EventEmitter } from 'events'; import { EditorRenderProps } from 'src/plugins/visualize/public'; import { Vis, VisualizeEmbeddableContract } from 'src/plugins/visualizations/public'; -import { KibanaContextProvider, PanelsContainer, Panel } from '../../kibana_react/public'; -import { Storage } from '../../kibana_utils/public'; +import { OpenSearchDashboardsContextProvider, PanelsContainer, Panel } from '../../opensearch_dashboards_react/public'; +import { Storage } from '../../opensearch_dashboardsutils/public'; import { DefaultEditorSideBar } from './components/sidebar'; import { getInitialWidth } from './editor_size'; @@ -82,7 +82,7 @@ function DefaultEditor({ return ( - - + ); } diff --git a/src/plugins/vis_default_editor/public/schemas.ts b/src/plugins/vis_default_editor/public/schemas.ts index d95a6252331b..7ba0f34f05a9 100644 --- a/src/plugins/vis_default_editor/public/schemas.ts +++ b/src/plugins/vis_default_editor/public/schemas.ts @@ -19,7 +19,7 @@ import _, { defaults } from 'lodash'; -import { Optional } from '@kbn/utility-types'; +import { Optional } from '@osd/utility-types'; import { AggGroupNames, AggParam, AggGroupName } from '../../data/public'; diff --git a/src/plugins/vis_default_editor/public/types.ts b/src/plugins/vis_default_editor/public/types.ts index 22fc24005994..972b97a92b9f 100644 --- a/src/plugins/vis_default_editor/public/types.ts +++ b/src/plugins/vis_default_editor/public/types.ts @@ -19,6 +19,6 @@ import { DataPublicPluginStart } from 'src/plugins/data/public'; -export interface VisDefaultEditorKibanaServices { +export interface VisDefaultEditorOpenSearchDashboardsServices { data: DataPublicPluginStart; }