From d560d74bb95826a9499c197d8d0b2f4b05912838 Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Thu, 16 Sep 2021 09:29:44 -0500 Subject: [PATCH] [data views] rename files from index patterns to data view (#112047) (#112408) * rename directories Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/data/common/search/search_source/search_source.test.ts # src/plugins/data/public/data_views/data_views/on_unsupported_time_pattern.tsx # src/plugins/data/public/data_views/index.ts # src/plugins/data/server/search/search_service.ts --- .../{index_patterns => data_views}/constants.ts | 0 .../__snapshots__/index_pattern.test.ts.snap | 0 .../__snapshots__/index_patterns.test.ts.snap | 0 .../data_views}/_pattern_cache.ts | 2 +- .../data_views/data_view.ts} | 0 .../data_views/data_views.ts} | 6 +++--- .../data_views/ensure_default_data_view.ts} | 12 ++++++------ .../data_views}/flatten_hit.test.ts | 2 +- .../data_views}/flatten_hit.ts | 2 +- .../data_views}/format_hit.ts | 2 +- .../data_views}/index.ts | 4 ++-- .../data_views}/index_pattern.stub.ts | 6 +++--- .../data_views}/index_pattern.test.ts | 2 +- .../data_views}/index_patterns.test.ts | 0 .../errors/duplicate_index_pattern.ts | 0 .../{index_patterns => data_views}/errors/index.ts | 0 .../expressions/index.ts | 0 .../expressions/load_index_pattern.ts | 2 +- .../{index_patterns => data_views}/field.stub.ts | 0 .../__snapshots__/index_pattern_field.test.ts.snap | 0 .../fields/field_list.ts | 2 +- .../fields/fields.mocks.ts | 0 .../{index_patterns => data_views}/fields/index.ts | 0 .../fields/index_pattern_field.test.ts | 2 +- .../fields/index_pattern_field.ts | 0 .../{index_patterns => data_views}/fields/types.ts | 0 .../{index_patterns => data_views}/fields/utils.ts | 0 .../common/{index_patterns => data_views}/index.ts | 10 +++------- .../index_pattern.stub.ts | 4 ++-- .../{index_patterns => data_views}/lib/errors.ts | 6 ++++++ .../{index_patterns => data_views}/lib/get_title.ts | 0 .../{index_patterns => data_views}/lib/index.ts | 0 .../{index_patterns => data_views}/lib/is_default.ts | 0 .../{index_patterns => data_views}/lib/types.ts | 0 .../lib/validate_index_pattern.test.ts | 0 .../lib/validate_index_pattern.ts | 0 .../common/{index_patterns => data_views}/mocks.ts | 2 +- .../common/{index_patterns => data_views}/types.ts | 0 .../{index_patterns => data_views}/utils.test.ts | 0 .../common/{index_patterns => data_views}/utils.ts | 2 +- src/plugins/data/common/index.ts | 4 ++-- src/plugins/data/common/mocks.ts | 2 +- .../data/common/search/aggs/agg_config.test.ts | 2 +- .../data/common/search/aggs/agg_configs.test.ts | 2 +- src/plugins/data/common/search/aggs/agg_configs.ts | 2 +- .../aggs/buckets/_terms_other_bucket_helper.test.ts | 4 ++-- .../common/search/aggs/buckets/date_histogram.ts | 2 +- .../data/common/search/aggs/buckets/terms.test.ts | 4 ++-- .../data/common/search/aggs/param_types/field.ts | 2 +- src/plugins/data/common/search/aggs/types.ts | 2 +- .../search/aggs/utils/datatable_column_meta.ts | 2 +- .../common/search/aggs/utils/infer_time_zone.test.ts | 2 +- .../data/common/search/aggs/utils/infer_time_zone.ts | 2 +- .../common/search/expressions/esaggs/esaggs_fn.ts | 4 ++-- .../expressions/esaggs/request_handler.test.ts | 2 +- src/plugins/data/common/search/expressions/esdsl.ts | 2 +- .../data/common/search/expressions/exists_filter.ts | 2 +- .../data/common/search/expressions/kibana_context.ts | 2 +- .../common/search/expressions/kibana_context_type.ts | 2 +- .../data/common/search/expressions/phrase_filter.ts | 2 +- .../data/common/search/expressions/range_filter.ts | 2 +- .../search_source/create_search_source.test.ts | 4 ++-- .../search/search_source/create_search_source.ts | 2 +- .../search_source/normalize_sort_request.test.ts | 2 +- .../search/search_source/normalize_sort_request.ts | 2 +- .../search/search_source/search_source.test.ts | 2 +- .../common/search/search_source/search_source.ts | 2 +- .../search_source/search_source_service.test.ts | 2 +- .../search/search_source/search_source_service.ts | 2 +- .../data/common/search/search_source/types.ts | 2 +- src/plugins/data/common/search/tabify/tabify.test.ts | 2 +- .../data/common/search/tabify/tabify_docs.test.ts | 2 +- src/plugins/data/common/search/tabify/tabify_docs.ts | 2 +- src/plugins/data/common/stubs.ts | 4 ++-- src/plugins/data/common/types.ts | 2 +- .../providers/query_suggestion_provider.ts | 2 +- .../data_views}/index.ts | 2 +- .../data_views}/index_pattern.stub.ts | 0 .../index_patterns_api_client.test.mock.ts | 0 .../data_views}/index_patterns_api_client.test.ts | 0 .../data_views}/index_patterns_api_client.ts | 4 ++-- .../data_views}/on_unsupported_time_pattern.tsx | 0 .../data_views}/redirect_no_index_pattern.tsx | 0 .../expressions/index.ts | 0 .../expressions/load_index_pattern.test.ts | 2 +- .../expressions/load_index_pattern.ts | 2 +- .../public/{index_patterns => data_views}/index.ts | 8 ++++---- .../saved_objects_client_wrapper.ts | 2 +- .../ui_settings_wrapper.ts | 2 +- src/plugins/data/public/index.ts | 8 ++++---- src/plugins/data/public/plugin.ts | 6 +++--- src/plugins/data/public/search/aggs/aggs_service.ts | 2 +- .../data/public/search/expressions/esaggs.test.ts | 2 +- src/plugins/data/public/search/expressions/esdsl.ts | 2 +- .../data/public/search/expressions/kibana_context.ts | 2 +- src/plugins/data/public/search/search_service.ts | 2 +- src/plugins/data/public/search/types.ts | 2 +- src/plugins/data/public/services.ts | 2 +- src/plugins/data/public/stubs.ts | 2 +- src/plugins/data/public/types.ts | 2 +- .../data/server/autocomplete/terms_agg.test.ts | 2 +- src/plugins/data/server/autocomplete/terms_agg.ts | 2 +- .../data/server/autocomplete/terms_enum.test.ts | 2 +- src/plugins/data/server/autocomplete/terms_enum.ts | 2 +- .../capabilities_provider.ts | 0 .../deprecations/index.ts | 0 .../deprecations/scripted_fields.test.ts | 0 .../deprecations/scripted_fields.ts | 0 .../server/{index_patterns => data_views}/error.ts | 0 .../expressions/index.ts | 0 .../expressions/load_index_pattern.test.ts | 2 +- .../expressions/load_index_pattern.ts | 2 +- .../{index_patterns => data_views}/fetcher/index.ts | 0 .../fetcher/index_patterns_fetcher.test.ts | 0 .../fetcher/index_patterns_fetcher.ts | 0 .../fetcher/lib/errors.ts | 0 .../fetcher/lib/es_api.test.js | 0 .../fetcher/lib/es_api.ts | 0 .../__fixtures__/es_field_caps_response.json | 0 .../field_capabilities/field_capabilities.test.js | 0 .../lib/field_capabilities/field_capabilities.ts | 0 .../field_capabilities/field_caps_response.test.js | 0 .../lib/field_capabilities/field_caps_response.ts | 0 .../fetcher/lib/field_capabilities/index.ts | 0 .../fetcher/lib/field_capabilities/overrides.ts | 0 .../should_read_field_from_doc_values.test.ts | 0 .../should_read_field_from_doc_values.ts | 0 .../fetcher/lib/index.ts | 0 .../fetcher/lib/jobs_compatibility.test.js | 0 .../fetcher/lib/jobs_compatibility.ts | 0 .../fetcher/lib/map_capabilities.ts | 0 .../fetcher/lib/merge_capabilities_with_fields.ts | 0 .../fetcher/lib/resolve_time_pattern.test.js | 0 .../fetcher/lib/resolve_time_pattern.ts | 0 .../fetcher/lib/time_pattern_to_wildcard.test.ts | 0 .../fetcher/lib/time_pattern_to_wildcard.ts | 0 .../has_user_index_pattern.test.ts | 0 .../has_user_index_pattern.ts | 4 ++-- .../server/{index_patterns => data_views}/index.ts | 0 .../index_patterns_api_client.ts | 4 ++-- .../index_patterns_service.ts | 0 .../server/{index_patterns => data_views}/mocks.ts | 0 .../register_index_pattern_usage_collection.test.ts | 0 .../register_index_pattern_usage_collection.ts | 0 .../server/{index_patterns => data_views}/routes.ts | 0 .../routes/create_index_pattern.ts | 0 .../routes/default_index_pattern.ts | 0 .../routes/delete_index_pattern.ts | 0 .../routes/fields/update_fields.ts | 0 .../routes/get_index_pattern.ts | 0 .../routes/has_user_index_pattern.ts | 2 +- .../routes/runtime_fields/create_runtime_field.ts | 0 .../routes/runtime_fields/delete_runtime_field.ts | 0 .../routes/runtime_fields/get_runtime_field.ts | 0 .../routes/runtime_fields/put_runtime_field.ts | 0 .../routes/runtime_fields/update_runtime_field.ts | 0 .../routes/scripted_fields/create_scripted_field.ts | 0 .../routes/scripted_fields/delete_scripted_field.ts | 0 .../routes/scripted_fields/get_scripted_field.ts | 0 .../routes/scripted_fields/put_scripted_field.ts | 0 .../routes/scripted_fields/update_scripted_field.ts | 0 .../routes/update_index_pattern.ts | 0 .../routes/util/handle_errors.ts | 0 .../routes/util/schemas.ts | 0 .../saved_objects_client_wrapper.ts | 2 +- .../ui_settings_wrapper.ts | 2 +- .../server/{index_patterns => data_views}/utils.ts | 0 src/plugins/data/server/index.ts | 2 +- src/plugins/data/server/mocks.ts | 2 +- src/plugins/data/server/plugin.ts | 2 +- .../data/server/search/aggs/aggs_service.test.ts | 2 +- src/plugins/data/server/search/aggs/aggs_service.ts | 2 +- .../data/server/search/expressions/esaggs.test.ts | 2 +- .../data/server/search/expressions/kibana_context.ts | 2 +- .../data/server/search/search_service.test.ts | 2 +- src/plugins/data/server/search/search_service.ts | 2 +- .../components/doc_table/lib/row_formatter.test.ts | 2 +- .../home/public/application/components/home_app.js | 2 +- .../home/server/services/new_instance_status.ts | 2 +- .../components/empty_prompts/empty_prompts.tsx | 2 +- .../scripted_field_table.test.tsx | 2 +- .../index_pattern_table/index_pattern_table.tsx | 2 +- .../public/components/overview/overview.tsx | 2 +- .../public/saved_object/saved_object.test.ts | 2 +- .../apis/index_patterns/es_errors/errors.js | 2 +- 185 files changed, 135 insertions(+), 133 deletions(-) rename src/plugins/data/common/{index_patterns => data_views}/constants.ts (100%) rename src/plugins/data/common/{index_patterns/index_patterns => data_views/data_views}/__snapshots__/index_pattern.test.ts.snap (100%) rename src/plugins/data/common/{index_patterns/index_patterns => data_views/data_views}/__snapshots__/index_patterns.test.ts.snap (100%) rename src/plugins/data/common/{index_patterns/index_patterns => data_views/data_views}/_pattern_cache.ts (96%) rename src/plugins/data/common/{index_patterns/index_patterns/index_pattern.ts => data_views/data_views/data_view.ts} (100%) rename src/plugins/data/common/{index_patterns/index_patterns/index_patterns.ts => data_views/data_views/data_views.ts} (99%) rename src/plugins/data/common/{index_patterns/index_patterns/ensure_default_index_pattern.ts => data_views/data_views/ensure_default_data_view.ts} (75%) rename src/plugins/data/common/{index_patterns/index_patterns => data_views/data_views}/flatten_hit.test.ts (97%) rename src/plugins/data/common/{index_patterns/index_patterns => data_views/data_views}/flatten_hit.ts (98%) rename src/plugins/data/common/{index_patterns/index_patterns => data_views/data_views}/format_hit.ts (98%) rename src/plugins/data/common/{index_patterns/index_patterns => data_views/data_views}/index.ts (87%) rename src/plugins/data/common/{index_patterns/index_patterns => data_views/data_views}/index_pattern.stub.ts (93%) rename src/plugins/data/common/{index_patterns/index_patterns => data_views/data_views}/index_pattern.test.ts (99%) rename src/plugins/data/common/{index_patterns/index_patterns => data_views/data_views}/index_patterns.test.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/errors/duplicate_index_pattern.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/errors/index.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/expressions/index.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/expressions/load_index_pattern.ts (97%) rename src/plugins/data/common/{index_patterns => data_views}/field.stub.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/fields/__snapshots__/index_pattern_field.test.ts.snap (100%) rename src/plugins/data/common/{index_patterns => data_views}/fields/field_list.ts (98%) rename src/plugins/data/common/{index_patterns => data_views}/fields/fields.mocks.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/fields/index.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/fields/index_pattern_field.test.ts (99%) rename src/plugins/data/common/{index_patterns => data_views}/fields/index_pattern_field.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/fields/types.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/fields/utils.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/index.ts (76%) rename src/plugins/data/common/{index_patterns => data_views}/index_pattern.stub.ts (90%) rename src/plugins/data/common/{index_patterns => data_views}/lib/errors.ts (82%) rename src/plugins/data/common/{index_patterns => data_views}/lib/get_title.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/lib/index.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/lib/is_default.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/lib/types.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/lib/validate_index_pattern.test.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/lib/validate_index_pattern.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/mocks.ts (88%) rename src/plugins/data/common/{index_patterns => data_views}/types.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/utils.test.ts (100%) rename src/plugins/data/common/{index_patterns => data_views}/utils.ts (93%) rename src/plugins/data/public/{index_patterns/index_patterns => data_views/data_views}/index.ts (88%) rename src/plugins/data/public/{index_patterns/index_patterns => data_views/data_views}/index_pattern.stub.ts (100%) rename src/plugins/data/public/{index_patterns/index_patterns => data_views/data_views}/index_patterns_api_client.test.mock.ts (100%) rename src/plugins/data/public/{index_patterns/index_patterns => data_views/data_views}/index_patterns_api_client.test.ts (100%) rename src/plugins/data/public/{index_patterns/index_patterns => data_views/data_views}/index_patterns_api_client.ts (94%) rename src/plugins/data/public/{index_patterns/index_patterns => data_views/data_views}/on_unsupported_time_pattern.tsx (100%) rename src/plugins/data/public/{index_patterns/index_patterns => data_views/data_views}/redirect_no_index_pattern.tsx (100%) rename src/plugins/data/public/{index_patterns => data_views}/expressions/index.ts (100%) rename src/plugins/data/public/{index_patterns => data_views}/expressions/load_index_pattern.test.ts (97%) rename src/plugins/data/public/{index_patterns => data_views}/expressions/load_index_pattern.ts (97%) rename src/plugins/data/public/{index_patterns => data_views}/index.ts (88%) rename src/plugins/data/public/{index_patterns => data_views}/saved_objects_client_wrapper.ts (98%) rename src/plugins/data/public/{index_patterns => data_views}/ui_settings_wrapper.ts (93%) rename src/plugins/data/server/{index_patterns => data_views}/capabilities_provider.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/deprecations/index.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/deprecations/scripted_fields.test.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/deprecations/scripted_fields.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/error.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/expressions/index.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/expressions/load_index_pattern.test.ts (98%) rename src/plugins/data/server/{index_patterns => data_views}/expressions/load_index_pattern.ts (98%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/index.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/index_patterns_fetcher.test.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/index_patterns_fetcher.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/errors.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/es_api.test.js (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/es_api.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/field_capabilities/__fixtures__/es_field_caps_response.json (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/field_capabilities/field_capabilities.test.js (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/field_capabilities/field_capabilities.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/field_capabilities/field_caps_response.test.js (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/field_capabilities/field_caps_response.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/field_capabilities/index.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/field_capabilities/overrides.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/field_capabilities/should_read_field_from_doc_values.test.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/field_capabilities/should_read_field_from_doc_values.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/index.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/jobs_compatibility.test.js (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/jobs_compatibility.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/map_capabilities.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/merge_capabilities_with_fields.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/resolve_time_pattern.test.js (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/resolve_time_pattern.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/time_pattern_to_wildcard.test.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/fetcher/lib/time_pattern_to_wildcard.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/has_user_index_pattern.test.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/has_user_index_pattern.ts (92%) rename src/plugins/data/server/{index_patterns => data_views}/index.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/index_patterns_api_client.ts (94%) rename src/plugins/data/server/{index_patterns => data_views}/index_patterns_service.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/mocks.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/register_index_pattern_usage_collection.test.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/register_index_pattern_usage_collection.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/create_index_pattern.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/default_index_pattern.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/delete_index_pattern.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/fields/update_fields.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/get_index_pattern.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/has_user_index_pattern.ts (95%) rename src/plugins/data/server/{index_patterns => data_views}/routes/runtime_fields/create_runtime_field.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/runtime_fields/delete_runtime_field.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/runtime_fields/get_runtime_field.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/runtime_fields/put_runtime_field.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/runtime_fields/update_runtime_field.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/scripted_fields/create_scripted_field.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/scripted_fields/delete_scripted_field.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/scripted_fields/get_scripted_field.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/scripted_fields/put_scripted_field.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/scripted_fields/update_scripted_field.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/update_index_pattern.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/util/handle_errors.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/routes/util/schemas.ts (100%) rename src/plugins/data/server/{index_patterns => data_views}/saved_objects_client_wrapper.ts (97%) rename src/plugins/data/server/{index_patterns => data_views}/ui_settings_wrapper.ts (93%) rename src/plugins/data/server/{index_patterns => data_views}/utils.ts (100%) diff --git a/src/plugins/data/common/index_patterns/constants.ts b/src/plugins/data/common/data_views/constants.ts similarity index 100% rename from src/plugins/data/common/index_patterns/constants.ts rename to src/plugins/data/common/data_views/constants.ts diff --git a/src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_pattern.test.ts.snap b/src/plugins/data/common/data_views/data_views/__snapshots__/index_pattern.test.ts.snap similarity index 100% rename from src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_pattern.test.ts.snap rename to src/plugins/data/common/data_views/data_views/__snapshots__/index_pattern.test.ts.snap diff --git a/src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_patterns.test.ts.snap b/src/plugins/data/common/data_views/data_views/__snapshots__/index_patterns.test.ts.snap similarity index 100% rename from src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_patterns.test.ts.snap rename to src/plugins/data/common/data_views/data_views/__snapshots__/index_patterns.test.ts.snap diff --git a/src/plugins/data/common/index_patterns/index_patterns/_pattern_cache.ts b/src/plugins/data/common/data_views/data_views/_pattern_cache.ts similarity index 96% rename from src/plugins/data/common/index_patterns/index_patterns/_pattern_cache.ts rename to src/plugins/data/common/data_views/data_views/_pattern_cache.ts index a647f306ca7f0..f304d0e93d79c 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/_pattern_cache.ts +++ b/src/plugins/data/common/data_views/data_views/_pattern_cache.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { DataView } from './index_pattern'; +import { DataView } from './data_view'; export interface DataViewCache { get: (id: string) => Promise | undefined; diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts b/src/plugins/data/common/data_views/data_views/data_view.ts similarity index 100% rename from src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts rename to src/plugins/data/common/data_views/data_views/data_view.ts diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts b/src/plugins/data/common/data_views/data_views/data_views.ts similarity index 99% rename from src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts rename to src/plugins/data/common/data_views/data_views/data_views.ts index 503b630dce475..dd9c322500f05 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts +++ b/src/plugins/data/common/data_views/data_views/data_views.ts @@ -15,8 +15,8 @@ import { DATA_VIEW_SAVED_OBJECT_TYPE, SavedObjectsClientCommon } from '../..'; import { createDataViewCache } from '.'; import type { RuntimeField } from '../types'; -import { DataView } from './index_pattern'; -import { createEnsureDefaultDataView, EnsureDefaultDataView } from './ensure_default_index_pattern'; +import { DataView } from './data_view'; +import { createEnsureDefaultDataView, EnsureDefaultDataView } from './ensure_default_data_view'; import { OnNotification, OnError, @@ -241,7 +241,7 @@ export class DataViewsService { /** * Checks if current user has a user created index pattern ignoring fleet's server default index patterns */ - async hasUserIndexPattern(): Promise { + async hasUserDataView(): Promise { return this.apiClient.hasUserIndexPattern(); } diff --git a/src/plugins/data/common/index_patterns/index_patterns/ensure_default_index_pattern.ts b/src/plugins/data/common/data_views/data_views/ensure_default_data_view.ts similarity index 75% rename from src/plugins/data/common/index_patterns/index_patterns/ensure_default_index_pattern.ts rename to src/plugins/data/common/data_views/data_views/ensure_default_data_view.ts index da20053bf1fe7..2975ddbd107c4 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/ensure_default_index_pattern.ts +++ b/src/plugins/data/common/data_views/data_views/ensure_default_data_view.ts @@ -7,17 +7,17 @@ */ import { includes } from 'lodash'; -import { DataViewsContract } from './index_patterns'; +import { DataViewsContract } from './data_views'; import { UiSettingsCommon } from '../types'; export type EnsureDefaultDataView = () => Promise | undefined; export const createEnsureDefaultDataView = ( uiSettings: UiSettingsCommon, - onRedirectNoIndexPattern: () => Promise | void + onRedirectNoDefaultView: () => Promise | void ) => { /** - * Checks whether a default index pattern is set and exists and defines + * Checks whether a default data view is set and exists and defines * one otherwise. */ return async function ensureDefaultDataView(this: DataViewsContract) { @@ -36,12 +36,12 @@ export const createEnsureDefaultDataView = ( } // If there is any user index pattern created, set the first as default - // if there is 0 patterns, then don't even call `hasUserIndexPattern()` - if (patterns.length >= 1 && (await this.hasUserIndexPattern().catch(() => true))) { + // if there is 0 patterns, then don't even call `hasUserDataView()` + if (patterns.length >= 1 && (await this.hasUserDataView().catch(() => true))) { defaultId = patterns[0]; await uiSettings.set('defaultIndex', defaultId); } else { - return onRedirectNoIndexPattern(); + return onRedirectNoDefaultView(); } }; }; diff --git a/src/plugins/data/common/index_patterns/index_patterns/flatten_hit.test.ts b/src/plugins/data/common/data_views/data_views/flatten_hit.test.ts similarity index 97% rename from src/plugins/data/common/index_patterns/index_patterns/flatten_hit.test.ts rename to src/plugins/data/common/data_views/data_views/flatten_hit.test.ts index 5cb531a97ff71..f8e1309a38ffe 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/flatten_hit.test.ts +++ b/src/plugins/data/common/data_views/data_views/flatten_hit.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPattern } from './index_pattern'; +import { IndexPattern } from './data_view'; import { fieldFormatsMock } from '../../../../field_formats/common/mocks'; import { flattenHitWrapper } from './flatten_hit'; diff --git a/src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts b/src/plugins/data/common/data_views/data_views/flatten_hit.ts similarity index 98% rename from src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts rename to src/plugins/data/common/data_views/data_views/flatten_hit.ts index 421994a9e02f1..58a5dff66acc8 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts +++ b/src/plugins/data/common/data_views/data_views/flatten_hit.ts @@ -7,7 +7,7 @@ */ import _ from 'lodash'; -import { DataView } from './index_pattern'; +import { DataView } from './data_view'; // Takes a hit, merges it with any stored/scripted fields, and with the metaFields // returns a flattened version diff --git a/src/plugins/data/common/index_patterns/index_patterns/format_hit.ts b/src/plugins/data/common/data_views/data_views/format_hit.ts similarity index 98% rename from src/plugins/data/common/index_patterns/index_patterns/format_hit.ts rename to src/plugins/data/common/data_views/data_views/format_hit.ts index 9ae630e8de651..b226013752628 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/format_hit.ts +++ b/src/plugins/data/common/data_views/data_views/format_hit.ts @@ -7,7 +7,7 @@ */ import _ from 'lodash'; -import { DataView } from './index_pattern'; +import { DataView } from './data_view'; import { FieldFormatsContentType } from '../../../../field_formats/common'; const formattedCache = new WeakMap(); diff --git a/src/plugins/data/common/index_patterns/index_patterns/index.ts b/src/plugins/data/common/data_views/data_views/index.ts similarity index 87% rename from src/plugins/data/common/index_patterns/index_patterns/index.ts rename to src/plugins/data/common/data_views/data_views/index.ts index b8b47cf099509..7c94dff961c9c 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index.ts +++ b/src/plugins/data/common/data_views/data_views/index.ts @@ -9,5 +9,5 @@ export * from './_pattern_cache'; export * from './flatten_hit'; export * from './format_hit'; -export * from './index_pattern'; -export * from './index_patterns'; +export * from './data_view'; +export * from './data_views'; diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.stub.ts b/src/plugins/data/common/data_views/data_views/index_pattern.stub.ts similarity index 93% rename from src/plugins/data/common/index_patterns/index_patterns/index_pattern.stub.ts rename to src/plugins/data/common/data_views/data_views/index_pattern.stub.ts index 0799afbb85937..3b6660c6d93dc 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.stub.ts +++ b/src/plugins/data/common/data_views/data_views/index_pattern.stub.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { IndexPattern } from './index_pattern'; -import { IndexPatternSpec } from '../types'; +import { IndexPattern } from './data_view'; +import { DataViewSpec } from '../types'; import { FieldFormatsStartCommon } from '../../../../field_formats/common'; import { fieldFormatsMock } from '../../../../field_formats/common/mocks'; @@ -37,7 +37,7 @@ export const createStubIndexPattern = ({ opts, deps, }: { - spec: IndexPatternSpec; + spec: DataViewSpec; opts?: { shortDotsEnable?: boolean; metaFields?: string[]; diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts b/src/plugins/data/common/data_views/data_views/index_pattern.test.ts similarity index 99% rename from src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts rename to src/plugins/data/common/data_views/data_views/index_pattern.test.ts index 1d97c6fa413ee..a12d4897fe11b 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts +++ b/src/plugins/data/common/data_views/data_views/index_pattern.test.ts @@ -8,7 +8,7 @@ import { map, last } from 'lodash'; -import { IndexPattern } from './index_pattern'; +import { IndexPattern } from './data_view'; import { DuplicateField } from '../../../../kibana_utils/common'; diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.test.ts b/src/plugins/data/common/data_views/data_views/index_patterns.test.ts similarity index 100% rename from src/plugins/data/common/index_patterns/index_patterns/index_patterns.test.ts rename to src/plugins/data/common/data_views/data_views/index_patterns.test.ts diff --git a/src/plugins/data/common/index_patterns/errors/duplicate_index_pattern.ts b/src/plugins/data/common/data_views/errors/duplicate_index_pattern.ts similarity index 100% rename from src/plugins/data/common/index_patterns/errors/duplicate_index_pattern.ts rename to src/plugins/data/common/data_views/errors/duplicate_index_pattern.ts diff --git a/src/plugins/data/common/index_patterns/errors/index.ts b/src/plugins/data/common/data_views/errors/index.ts similarity index 100% rename from src/plugins/data/common/index_patterns/errors/index.ts rename to src/plugins/data/common/data_views/errors/index.ts diff --git a/src/plugins/data/common/index_patterns/expressions/index.ts b/src/plugins/data/common/data_views/expressions/index.ts similarity index 100% rename from src/plugins/data/common/index_patterns/expressions/index.ts rename to src/plugins/data/common/data_views/expressions/index.ts diff --git a/src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts b/src/plugins/data/common/data_views/expressions/load_index_pattern.ts similarity index 97% rename from src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts rename to src/plugins/data/common/data_views/expressions/load_index_pattern.ts index 8fe9e40e0ac6c..dd47a9fc0dfb4 100644 --- a/src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts +++ b/src/plugins/data/common/data_views/expressions/load_index_pattern.ts @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; -import { DataViewsContract } from '../index_patterns'; +import { DataViewsContract } from '../data_views'; import { DataViewSpec } from '..'; import { SavedObjectReference } from '../../../../../core/types'; diff --git a/src/plugins/data/common/index_patterns/field.stub.ts b/src/plugins/data/common/data_views/field.stub.ts similarity index 100% rename from src/plugins/data/common/index_patterns/field.stub.ts rename to src/plugins/data/common/data_views/field.stub.ts diff --git a/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap b/src/plugins/data/common/data_views/fields/__snapshots__/index_pattern_field.test.ts.snap similarity index 100% rename from src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap rename to src/plugins/data/common/data_views/fields/__snapshots__/index_pattern_field.test.ts.snap diff --git a/src/plugins/data/common/index_patterns/fields/field_list.ts b/src/plugins/data/common/data_views/fields/field_list.ts similarity index 98% rename from src/plugins/data/common/index_patterns/fields/field_list.ts rename to src/plugins/data/common/data_views/fields/field_list.ts index 78cc390c8c13f..8dd407e16e4c0 100644 --- a/src/plugins/data/common/index_patterns/fields/field_list.ts +++ b/src/plugins/data/common/data_views/fields/field_list.ts @@ -10,7 +10,7 @@ import { findIndex } from 'lodash'; import { IFieldType } from './types'; import { DataViewField } from './index_pattern_field'; import { FieldSpec, DataViewFieldMap } from '../types'; -import { DataView } from '../index_patterns'; +import { DataView } from '../data_views'; type FieldMap = Map; diff --git a/src/plugins/data/common/index_patterns/fields/fields.mocks.ts b/src/plugins/data/common/data_views/fields/fields.mocks.ts similarity index 100% rename from src/plugins/data/common/index_patterns/fields/fields.mocks.ts rename to src/plugins/data/common/data_views/fields/fields.mocks.ts diff --git a/src/plugins/data/common/index_patterns/fields/index.ts b/src/plugins/data/common/data_views/fields/index.ts similarity index 100% rename from src/plugins/data/common/index_patterns/fields/index.ts rename to src/plugins/data/common/data_views/fields/index.ts diff --git a/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts b/src/plugins/data/common/data_views/fields/index_pattern_field.test.ts similarity index 99% rename from src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts rename to src/plugins/data/common/data_views/fields/index_pattern_field.test.ts index 51687cfd82600..18d331b4e1351 100644 --- a/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts +++ b/src/plugins/data/common/data_views/fields/index_pattern_field.test.ts @@ -7,7 +7,7 @@ */ import { IndexPatternField } from './index_pattern_field'; -import { IndexPattern } from '../index_patterns'; +import { IndexPattern } from '..'; import { KBN_FIELD_TYPES } from '../../../common'; import { FieldSpec, RuntimeField } from '../types'; import { FieldFormat } from '../../../../field_formats/common'; diff --git a/src/plugins/data/common/index_patterns/fields/index_pattern_field.ts b/src/plugins/data/common/data_views/fields/index_pattern_field.ts similarity index 100% rename from src/plugins/data/common/index_patterns/fields/index_pattern_field.ts rename to src/plugins/data/common/data_views/fields/index_pattern_field.ts diff --git a/src/plugins/data/common/index_patterns/fields/types.ts b/src/plugins/data/common/data_views/fields/types.ts similarity index 100% rename from src/plugins/data/common/index_patterns/fields/types.ts rename to src/plugins/data/common/data_views/fields/types.ts diff --git a/src/plugins/data/common/index_patterns/fields/utils.ts b/src/plugins/data/common/data_views/fields/utils.ts similarity index 100% rename from src/plugins/data/common/index_patterns/fields/utils.ts rename to src/plugins/data/common/data_views/fields/utils.ts diff --git a/src/plugins/data/common/index_patterns/index.ts b/src/plugins/data/common/data_views/index.ts similarity index 76% rename from src/plugins/data/common/index_patterns/index.ts rename to src/plugins/data/common/data_views/index.ts index 99639676bdabf..fd1df0336815a 100644 --- a/src/plugins/data/common/index_patterns/index.ts +++ b/src/plugins/data/common/data_views/index.ts @@ -14,12 +14,8 @@ export { IndexPatternsContract, DataViewsService, DataViewsContract, -} from './index_patterns'; -export type { - IndexPattern, - IndexPatternListItem, - DataView, - DataViewListItem, -} from './index_patterns'; +} from './data_views'; +// todo was trying to export this as type but wasn't working +export { IndexPattern, IndexPatternListItem, DataView, DataViewListItem } from './data_views'; export * from './errors'; export * from './expressions'; diff --git a/src/plugins/data/common/index_patterns/index_pattern.stub.ts b/src/plugins/data/common/data_views/index_pattern.stub.ts similarity index 90% rename from src/plugins/data/common/index_patterns/index_pattern.stub.ts rename to src/plugins/data/common/data_views/index_pattern.stub.ts index 13cda8ccfb845..16624087f83b3 100644 --- a/src/plugins/data/common/index_patterns/index_pattern.stub.ts +++ b/src/plugins/data/common/data_views/index_pattern.stub.ts @@ -7,8 +7,8 @@ */ import { stubFieldSpecMap, stubLogstashFieldSpecMap } from './field.stub'; -import { createStubIndexPattern } from './index_patterns/index_pattern.stub'; -export { createStubIndexPattern } from './index_patterns/index_pattern.stub'; +import { createStubIndexPattern } from './data_views/index_pattern.stub'; +export { createStubIndexPattern } from './data_views/index_pattern.stub'; import { SavedObject } from '../../../../core/types'; import { IndexPatternAttributes } from '../types'; diff --git a/src/plugins/data/common/index_patterns/lib/errors.ts b/src/plugins/data/common/data_views/lib/errors.ts similarity index 82% rename from src/plugins/data/common/index_patterns/lib/errors.ts rename to src/plugins/data/common/data_views/lib/errors.ts index 20f422c5124e6..83cc7ea56d020 100644 --- a/src/plugins/data/common/index_patterns/lib/errors.ts +++ b/src/plugins/data/common/data_views/lib/errors.ts @@ -22,3 +22,9 @@ export class DataViewMissingIndices extends KbnError { ); } } + +/** + * @deprecated Use DataViewMissingIndices. All index pattern interfaces were renamed. + */ + +export class IndexPatternMissingIndices extends DataViewMissingIndices {} diff --git a/src/plugins/data/common/index_patterns/lib/get_title.ts b/src/plugins/data/common/data_views/lib/get_title.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/get_title.ts rename to src/plugins/data/common/data_views/lib/get_title.ts diff --git a/src/plugins/data/common/index_patterns/lib/index.ts b/src/plugins/data/common/data_views/lib/index.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/index.ts rename to src/plugins/data/common/data_views/lib/index.ts diff --git a/src/plugins/data/common/index_patterns/lib/is_default.ts b/src/plugins/data/common/data_views/lib/is_default.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/is_default.ts rename to src/plugins/data/common/data_views/lib/is_default.ts diff --git a/src/plugins/data/common/index_patterns/lib/types.ts b/src/plugins/data/common/data_views/lib/types.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/types.ts rename to src/plugins/data/common/data_views/lib/types.ts diff --git a/src/plugins/data/common/index_patterns/lib/validate_index_pattern.test.ts b/src/plugins/data/common/data_views/lib/validate_index_pattern.test.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/validate_index_pattern.test.ts rename to src/plugins/data/common/data_views/lib/validate_index_pattern.test.ts diff --git a/src/plugins/data/common/index_patterns/lib/validate_index_pattern.ts b/src/plugins/data/common/data_views/lib/validate_index_pattern.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/validate_index_pattern.ts rename to src/plugins/data/common/data_views/lib/validate_index_pattern.ts diff --git a/src/plugins/data/common/index_patterns/mocks.ts b/src/plugins/data/common/data_views/mocks.ts similarity index 88% rename from src/plugins/data/common/index_patterns/mocks.ts rename to src/plugins/data/common/data_views/mocks.ts index b8b3b67c56df3..6e82118f7b8b8 100644 --- a/src/plugins/data/common/index_patterns/mocks.ts +++ b/src/plugins/data/common/data_views/mocks.ts @@ -7,4 +7,4 @@ */ export * from './fields/fields.mocks'; -export * from './index_patterns/index_pattern.stub'; +export * from './data_views/index_pattern.stub'; diff --git a/src/plugins/data/common/index_patterns/types.ts b/src/plugins/data/common/data_views/types.ts similarity index 100% rename from src/plugins/data/common/index_patterns/types.ts rename to src/plugins/data/common/data_views/types.ts diff --git a/src/plugins/data/common/index_patterns/utils.test.ts b/src/plugins/data/common/data_views/utils.test.ts similarity index 100% rename from src/plugins/data/common/index_patterns/utils.test.ts rename to src/plugins/data/common/data_views/utils.test.ts diff --git a/src/plugins/data/common/index_patterns/utils.ts b/src/plugins/data/common/data_views/utils.ts similarity index 93% rename from src/plugins/data/common/index_patterns/utils.ts rename to src/plugins/data/common/data_views/utils.ts index 48a0776dc43a8..2d36ab6c72225 100644 --- a/src/plugins/data/common/index_patterns/utils.ts +++ b/src/plugins/data/common/data_views/utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { IndexPatternSavedObjectAttrs } from './index_patterns'; +import type { IndexPatternSavedObjectAttrs } from './data_views'; import type { SavedObjectsClientCommon } from '../types'; import { DATA_VIEW_SAVED_OBJECT_TYPE } from '../constants'; diff --git a/src/plugins/data/common/index.ts b/src/plugins/data/common/index.ts index 44285a4824211..8a9a93f96b68b 100644 --- a/src/plugins/data/common/index.ts +++ b/src/plugins/data/common/index.ts @@ -11,7 +11,7 @@ export * from './constants'; export * from './es_query'; -export * from './index_patterns'; +export * from './data_views'; export * from './kbn_field_types'; export * from './query'; export * from './search'; @@ -25,4 +25,4 @@ export * from './exports'; * @removeBy 8.1 */ -export { IndexPatternAttributes, DataViewAttributes } from './types'; +export { IndexPatternAttributes } from './types'; diff --git a/src/plugins/data/common/mocks.ts b/src/plugins/data/common/mocks.ts index a9fc4c822a66e..66ad3b695d24c 100644 --- a/src/plugins/data/common/mocks.ts +++ b/src/plugins/data/common/mocks.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export * from './index_patterns/fields/fields.mocks'; +export * from './data_views/fields/fields.mocks'; diff --git a/src/plugins/data/common/search/aggs/agg_config.test.ts b/src/plugins/data/common/search/aggs/agg_config.test.ts index d15cccebd08fc..2cb875eb9c047 100644 --- a/src/plugins/data/common/search/aggs/agg_config.test.ts +++ b/src/plugins/data/common/search/aggs/agg_config.test.ts @@ -15,7 +15,7 @@ import { AggType } from './agg_type'; import { AggTypesRegistryStart } from './agg_types_registry'; import { mockAggTypesRegistry } from './test_helpers'; import { MetricAggType } from './metrics/metric_agg_type'; -import { IndexPattern, IndexPatternField, IIndexPatternFieldList } from '../../index_patterns'; +import { IndexPattern, IndexPatternField, IIndexPatternFieldList } from '../..'; describe('AggConfig', () => { let indexPattern: IndexPattern; diff --git a/src/plugins/data/common/search/aggs/agg_configs.test.ts b/src/plugins/data/common/search/aggs/agg_configs.test.ts index 978ec79147a13..59b306c2df0b1 100644 --- a/src/plugins/data/common/search/aggs/agg_configs.test.ts +++ b/src/plugins/data/common/search/aggs/agg_configs.test.ts @@ -11,7 +11,7 @@ import { AggConfig } from './agg_config'; import { AggConfigs } from './agg_configs'; import { AggTypesRegistryStart } from './agg_types_registry'; import { mockAggTypesRegistry } from './test_helpers'; -import { IndexPattern } from '../../index_patterns/'; +import { IndexPattern } from '../..'; import { stubIndexPattern } from '../../stubs'; import { IEsSearchResponse } from '..'; diff --git a/src/plugins/data/common/search/aggs/agg_configs.ts b/src/plugins/data/common/search/aggs/agg_configs.ts index c80becd271bba..08a7022ee8942 100644 --- a/src/plugins/data/common/search/aggs/agg_configs.ts +++ b/src/plugins/data/common/search/aggs/agg_configs.ts @@ -23,7 +23,7 @@ import { AggConfig, AggConfigSerialized, IAggConfig } from './agg_config'; import { IAggType } from './agg_type'; import { AggTypesRegistryStart } from './agg_types_registry'; import { AggGroupNames } from './agg_groups'; -import { IndexPattern } from '../../index_patterns/index_patterns/index_pattern'; +import { IndexPattern } from '../..'; import { TimeRange, getTime, calculateBounds } from '../../../common'; import { IBucketAggConfig } from './buckets'; import { insertTimeShiftSplit, mergeTimeShifts } from './utils/time_splits'; diff --git a/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts b/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts index 523bbe1f01018..9d61178405b52 100644 --- a/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts +++ b/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts @@ -16,8 +16,8 @@ import { AggConfigs, CreateAggConfigParams } from '../agg_configs'; import { BUCKET_TYPES } from './bucket_agg_types'; import { IBucketAggConfig } from './bucket_agg_type'; import { mockAggTypesRegistry } from '../test_helpers'; -import type { IndexPatternField } from '../../../index_patterns'; -import { IndexPattern } from '../../../index_patterns/index_patterns/index_pattern'; +import type { IndexPatternField } from '../../..'; +import { IndexPattern } from '../../..'; const indexPattern = { id: '1234', diff --git a/src/plugins/data/common/search/aggs/buckets/date_histogram.ts b/src/plugins/data/common/search/aggs/buckets/date_histogram.ts index befffe915b6ab..f2bd6ea734e04 100644 --- a/src/plugins/data/common/search/aggs/buckets/date_histogram.ts +++ b/src/plugins/data/common/search/aggs/buckets/date_histogram.ts @@ -11,7 +11,7 @@ import moment from 'moment-timezone'; import { i18n } from '@kbn/i18n'; import { KBN_FIELD_TYPES, TimeRange, TimeRangeBounds, UI_SETTINGS } from '../../../../common'; -import { IFieldType } from '../../../index_patterns'; +import { IFieldType } from '../../..'; import { ExtendedBounds, extendedBoundsToAst, timerangeToAst } from '../../expressions'; import { intervalOptions, autoInterval, isAutoInterval } from './_interval_options'; diff --git a/src/plugins/data/common/search/aggs/buckets/terms.test.ts b/src/plugins/data/common/search/aggs/buckets/terms.test.ts index 09dfbb28a4e53..6345e29b6fbe4 100644 --- a/src/plugins/data/common/search/aggs/buckets/terms.test.ts +++ b/src/plugins/data/common/search/aggs/buckets/terms.test.ts @@ -10,8 +10,8 @@ import { AggConfigs } from '../agg_configs'; import { METRIC_TYPES } from '../metrics'; import { mockAggTypesRegistry } from '../test_helpers'; import { BUCKET_TYPES } from './bucket_agg_types'; -import type { IndexPatternField } from '../../../index_patterns'; -import { IndexPattern } from '../../../index_patterns/index_patterns/index_pattern'; +import type { IndexPatternField } from '../../..'; +import { IndexPattern } from '../../..'; describe('Terms Agg', () => { describe('order agg editor UI', () => { diff --git a/src/plugins/data/common/search/aggs/param_types/field.ts b/src/plugins/data/common/search/aggs/param_types/field.ts index 62dac9831211a..e1c872ac16701 100644 --- a/src/plugins/data/common/search/aggs/param_types/field.ts +++ b/src/plugins/data/common/search/aggs/param_types/field.ts @@ -15,7 +15,7 @@ import { import { BaseParamType } from './base'; import { propFilter } from '../utils'; import { KBN_FIELD_TYPES } from '../../../kbn_field_types/types'; -import { isNestedField, IndexPatternField } from '../../../index_patterns/fields'; +import { isNestedField, IndexPatternField } from '../../../data_views/fields'; const filterByType = propFilter('type'); diff --git a/src/plugins/data/common/search/aggs/types.ts b/src/plugins/data/common/search/aggs/types.ts index 7d5b7d4eeff9e..7a87a83b7b00b 100644 --- a/src/plugins/data/common/search/aggs/types.ts +++ b/src/plugins/data/common/search/aggs/types.ts @@ -8,7 +8,7 @@ import { Assign } from '@kbn/utility-types'; import { DatatableColumn } from 'src/plugins/expressions'; -import { IndexPattern } from '../../index_patterns/index_patterns/index_pattern'; +import { IndexPattern } from '../..'; import { aggAvg, aggBucketAvg, diff --git a/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts b/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts index c5e09e6622850..0e3ff69fac1d1 100644 --- a/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts +++ b/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts @@ -7,7 +7,7 @@ */ import { DatatableColumn } from 'src/plugins/expressions/common'; -import { IndexPattern } from '../../../index_patterns'; +import { IndexPattern } from '../../..'; import { AggConfigs, CreateAggConfigParams } from '../agg_configs'; import { AggTypesRegistryStart } from '../agg_types_registry'; import { IAggType } from '../agg_type'; diff --git a/src/plugins/data/common/search/aggs/utils/infer_time_zone.test.ts b/src/plugins/data/common/search/aggs/utils/infer_time_zone.test.ts index 0c94769f0538e..91f69f3bfb148 100644 --- a/src/plugins/data/common/search/aggs/utils/infer_time_zone.test.ts +++ b/src/plugins/data/common/search/aggs/utils/infer_time_zone.test.ts @@ -18,7 +18,7 @@ jest.mock('moment', () => { return moment; }); -import { IndexPattern, IndexPatternField } from '../../../index_patterns'; +import { IndexPattern, IndexPatternField } from '../../..'; import { AggParamsDateHistogram } from '../buckets'; import { inferTimeZone } from './infer_time_zone'; diff --git a/src/plugins/data/common/search/aggs/utils/infer_time_zone.ts b/src/plugins/data/common/search/aggs/utils/infer_time_zone.ts index b031fb890b77c..21c022d8e293c 100644 --- a/src/plugins/data/common/search/aggs/utils/infer_time_zone.ts +++ b/src/plugins/data/common/search/aggs/utils/infer_time_zone.ts @@ -7,7 +7,7 @@ */ import moment from 'moment'; -import { IndexPattern } from '../../../index_patterns'; +import { IndexPattern } from '../../..'; import { AggParamsDateHistogram } from '../buckets'; export function inferTimeZone( diff --git a/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts b/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts index 496225ad9f00b..a9078d6042db8 100644 --- a/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts +++ b/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts @@ -12,8 +12,8 @@ import { Observable } from 'rxjs'; import type { Datatable, ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; import { buildExpressionFunction } from '../../../../../../plugins/expressions/common'; -import { IndexPatternExpressionType } from '../../../index_patterns/expressions'; -import { IndexPatternsContract } from '../../../index_patterns/index_patterns'; +import { IndexPatternExpressionType } from '../../../data_views/expressions'; +import { IndexPatternsContract } from '../../..'; import { AggsStart, AggExpressionType, aggCountFnName } from '../../aggs'; import { ISearchStartSearchSource } from '../../search_source'; diff --git a/src/plugins/data/common/search/expressions/esaggs/request_handler.test.ts b/src/plugins/data/common/search/expressions/esaggs/request_handler.test.ts index dae3661f00c27..56f6c9da6d84a 100644 --- a/src/plugins/data/common/search/expressions/esaggs/request_handler.test.ts +++ b/src/plugins/data/common/search/expressions/esaggs/request_handler.test.ts @@ -9,7 +9,7 @@ import { from } from 'rxjs'; import type { MockedKeys } from '@kbn/utility-types/jest'; import type { Filter } from '../../../es_query'; -import type { IndexPattern } from '../../../index_patterns'; +import type { IndexPattern } from '../../..'; import type { IAggConfigs } from '../../aggs'; import type { ISearchSource } from '../../search_source'; import { searchSourceCommonMock, searchSourceInstanceMock } from '../../search_source/mocks'; diff --git a/src/plugins/data/common/search/expressions/esdsl.ts b/src/plugins/data/common/search/expressions/esdsl.ts index a5834001143e4..c5b116073c06b 100644 --- a/src/plugins/data/common/search/expressions/esdsl.ts +++ b/src/plugins/data/common/search/expressions/esdsl.ts @@ -14,7 +14,7 @@ import { EsRawResponse } from './es_raw_response'; import { RequestStatistics, RequestAdapter } from '../../../../inspector/common'; import { ISearchGeneric, KibanaContext } from '..'; import { getEsQueryConfig } from '../../es_query'; -import { UiSettingsCommon } from '../../index_patterns'; +import { UiSettingsCommon } from '../..'; const name = 'esdsl'; diff --git a/src/plugins/data/common/search/expressions/exists_filter.ts b/src/plugins/data/common/search/expressions/exists_filter.ts index 75d83ca7f2592..3edb659966466 100644 --- a/src/plugins/data/common/search/expressions/exists_filter.ts +++ b/src/plugins/data/common/search/expressions/exists_filter.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; import { buildFilter, FILTERS } from '@kbn/es-query'; import { KibanaField, KibanaFilter } from './kibana_context_type'; -import { IndexPattern } from '../../index_patterns/index_patterns'; +import { IndexPattern } from '../..'; interface Arguments { field: KibanaField; diff --git a/src/plugins/data/common/search/expressions/kibana_context.ts b/src/plugins/data/common/search/expressions/kibana_context.ts index fb766b497c39c..47ca24b5be42b 100644 --- a/src/plugins/data/common/search/expressions/kibana_context.ts +++ b/src/plugins/data/common/search/expressions/kibana_context.ts @@ -17,7 +17,7 @@ import { ExecutionContextSearch, KibanaContext, KibanaFilter } from './kibana_co import { KibanaQueryOutput } from './kibana_context_type'; import { KibanaTimerangeOutput } from './timerange'; import { SavedObjectReference } from '../../../../../core/types'; -import { SavedObjectsClientCommon } from '../../index_patterns'; +import { SavedObjectsClientCommon } from '../..'; /** @internal */ export interface KibanaContextStartDependencies { diff --git a/src/plugins/data/common/search/expressions/kibana_context_type.ts b/src/plugins/data/common/search/expressions/kibana_context_type.ts index ae38faf6b2448..9cc69c769f695 100644 --- a/src/plugins/data/common/search/expressions/kibana_context_type.ts +++ b/src/plugins/data/common/search/expressions/kibana_context_type.ts @@ -8,7 +8,7 @@ import { ExpressionValueBoxed } from 'src/plugins/expressions/common'; import { Filter } from '../../es_query'; import { Query, TimeRange } from '../../query'; -import { IndexPatternField } from '../../index_patterns/fields'; +import { IndexPatternField } from '../..'; // eslint-disable-next-line @typescript-eslint/consistent-type-definitions export type ExecutionContextSearch = { diff --git a/src/plugins/data/common/search/expressions/phrase_filter.ts b/src/plugins/data/common/search/expressions/phrase_filter.ts index 837d4be4d52ea..6714edef55000 100644 --- a/src/plugins/data/common/search/expressions/phrase_filter.ts +++ b/src/plugins/data/common/search/expressions/phrase_filter.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; import { buildFilter, FILTERS } from '@kbn/es-query'; import { KibanaField, KibanaFilter } from './kibana_context_type'; -import { IndexPattern } from '../../index_patterns/index_patterns'; +import { IndexPattern } from '../..'; interface Arguments { field: KibanaField; diff --git a/src/plugins/data/common/search/expressions/range_filter.ts b/src/plugins/data/common/search/expressions/range_filter.ts index ed65475a9d285..bac50f2000271 100644 --- a/src/plugins/data/common/search/expressions/range_filter.ts +++ b/src/plugins/data/common/search/expressions/range_filter.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; import { buildFilter, FILTERS } from '@kbn/es-query'; import { KibanaField, KibanaFilter } from './kibana_context_type'; -import { IndexPattern } from '../../index_patterns/index_patterns'; +import { IndexPattern } from '../..'; import { KibanaRange } from './range'; interface Arguments { diff --git a/src/plugins/data/common/search/search_source/create_search_source.test.ts b/src/plugins/data/common/search/search_source/create_search_source.test.ts index c084b029a5bd2..9ac9dc93a807e 100644 --- a/src/plugins/data/common/search/search_source/create_search_source.test.ts +++ b/src/plugins/data/common/search/search_source/create_search_source.test.ts @@ -8,8 +8,8 @@ import { createSearchSource as createSearchSourceFactory } from './create_search_source'; import { SearchSourceDependencies } from './search_source'; -import { IIndexPattern } from '../../index_patterns'; -import { IndexPatternsContract } from '../../index_patterns/index_patterns'; +import { IIndexPattern } from '../..'; +import { IndexPatternsContract } from '../..'; import { Filter } from '../../es_query'; describe('createSearchSource', () => { diff --git a/src/plugins/data/common/search/search_source/create_search_source.ts b/src/plugins/data/common/search/search_source/create_search_source.ts index 3f7a290d812cf..80547ca2e71f2 100644 --- a/src/plugins/data/common/search/search_source/create_search_source.ts +++ b/src/plugins/data/common/search/search_source/create_search_source.ts @@ -8,7 +8,7 @@ import { migrateLegacyQuery } from './migrate_legacy_query'; import { SearchSource, SearchSourceDependencies } from './search_source'; -import { IndexPatternsContract } from '../../index_patterns/index_patterns'; +import { IndexPatternsContract } from '../..'; import { SearchSourceFields } from './types'; /** diff --git a/src/plugins/data/common/search/search_source/normalize_sort_request.test.ts b/src/plugins/data/common/search/search_source/normalize_sort_request.test.ts index 9155f1a55d432..689740326ab9d 100644 --- a/src/plugins/data/common/search/search_source/normalize_sort_request.test.ts +++ b/src/plugins/data/common/search/search_source/normalize_sort_request.test.ts @@ -8,7 +8,7 @@ import { normalizeSortRequest } from './normalize_sort_request'; import { SortDirection } from './types'; -import { IIndexPattern } from '../../index_patterns'; +import { IIndexPattern } from '../..'; describe('SearchSource#normalizeSortRequest', function () { const scriptedField = { diff --git a/src/plugins/data/common/search/search_source/normalize_sort_request.ts b/src/plugins/data/common/search/search_source/normalize_sort_request.ts index 928daa7ad963c..3d8f9482d16d9 100644 --- a/src/plugins/data/common/search/search_source/normalize_sort_request.ts +++ b/src/plugins/data/common/search/search_source/normalize_sort_request.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IIndexPattern } from '../../index_patterns'; +import { IIndexPattern } from '../..'; import { EsQuerySortValue, SortOptions } from './types'; export function normalizeSortRequest( diff --git a/src/plugins/data/common/search/search_source/search_source.test.ts b/src/plugins/data/common/search/search_source/search_source.test.ts index e3fc925f1ccb1..cb7f2904ead28 100644 --- a/src/plugins/data/common/search/search_source/search_source.test.ts +++ b/src/plugins/data/common/search/search_source/search_source.test.ts @@ -7,8 +7,8 @@ */ import { of } from 'rxjs'; -import { IndexPattern } from '../../index_patterns'; import { GetConfigFn } from '../../types'; +import { IndexPattern } from '../..'; import { SearchSource, SearchSourceDependencies, SortDirection } from './'; import { AggConfigs, AggTypesRegistryStart, ES_SEARCH_STRATEGY } from '../../'; import { mockAggTypesRegistry } from '../aggs/test_helpers'; diff --git a/src/plugins/data/common/search/search_source/search_source.ts b/src/plugins/data/common/search/search_source/search_source.ts index a90a5ac632e3e..25e597c2e45be 100644 --- a/src/plugins/data/common/search/search_source/search_source.ts +++ b/src/plugins/data/common/search/search_source/search_source.ts @@ -75,7 +75,7 @@ import { estypes } from '@elastic/elasticsearch'; import { buildEsQuery, Filter } from '@kbn/es-query'; import { normalizeSortRequest } from './normalize_sort_request'; import { fieldWildcardFilter } from '../../../../kibana_utils/common'; -import { IIndexPattern, IndexPattern, IndexPatternField } from '../../index_patterns'; +import { IIndexPattern, IndexPattern, IndexPatternField } from '../..'; import { AggConfigs, ES_SEARCH_STRATEGY, diff --git a/src/plugins/data/common/search/search_source/search_source_service.test.ts b/src/plugins/data/common/search/search_source/search_source_service.test.ts index 23bb809092bde..69ffef3f9ccd6 100644 --- a/src/plugins/data/common/search/search_source/search_source_service.test.ts +++ b/src/plugins/data/common/search/search_source/search_source_service.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPatternsContract } from '../../index_patterns/index_patterns'; +import { IndexPatternsContract } from '../..'; import { SearchSourceService, SearchSourceDependencies } from './'; describe('SearchSource service', () => { diff --git a/src/plugins/data/common/search/search_source/search_source_service.ts b/src/plugins/data/common/search/search_source/search_source_service.ts index 1db63247a1722..886420365f548 100644 --- a/src/plugins/data/common/search/search_source/search_source_service.ts +++ b/src/plugins/data/common/search/search_source/search_source_service.ts @@ -7,7 +7,7 @@ */ import { createSearchSource, SearchSource, SearchSourceDependencies } from './'; -import { IndexPatternsContract } from '../../index_patterns/index_patterns'; +import { IndexPatternsContract } from '../..'; export class SearchSourceService { public setup() {} diff --git a/src/plugins/data/common/search/search_source/types.ts b/src/plugins/data/common/search/search_source/types.ts index f9dbd83295b14..a19316c1c8418 100644 --- a/src/plugins/data/common/search/search_source/types.ts +++ b/src/plugins/data/common/search/search_source/types.ts @@ -9,7 +9,7 @@ import type { estypes } from '@elastic/elasticsearch'; import { IAggConfigs } from 'src/plugins/data/public'; import { Query } from '../..'; import { Filter } from '../../es_query'; -import { IndexPattern } from '../../index_patterns'; +import { IndexPattern } from '../..'; import { SearchSource } from './search_source'; /** diff --git a/src/plugins/data/common/search/tabify/tabify.test.ts b/src/plugins/data/common/search/tabify/tabify.test.ts index 478f1ab131346..329d1597268dc 100644 --- a/src/plugins/data/common/search/tabify/tabify.test.ts +++ b/src/plugins/data/common/search/tabify/tabify.test.ts @@ -7,7 +7,7 @@ */ import { tabifyAggResponse } from './tabify'; -import { IndexPattern } from '../../index_patterns/index_patterns/index_pattern'; +import { IndexPattern } from '../..'; import { AggConfigs, IAggConfig, IAggConfigs } from '../aggs'; import { mockAggTypesRegistry } from '../aggs/test_helpers'; import { metricOnly, threeTermBuckets } from './fixtures/fake_hierarchical_data'; diff --git a/src/plugins/data/common/search/tabify/tabify_docs.test.ts b/src/plugins/data/common/search/tabify/tabify_docs.test.ts index 113086795b3e2..1a3f7195b722e 100644 --- a/src/plugins/data/common/search/tabify/tabify_docs.test.ts +++ b/src/plugins/data/common/search/tabify/tabify_docs.test.ts @@ -7,7 +7,7 @@ */ import { tabifyDocs } from './tabify_docs'; -import { IndexPattern } from '../../index_patterns/index_patterns'; +import { IndexPattern } from '../..'; import type { estypes } from '@elastic/elasticsearch'; describe('tabifyDocs', () => { diff --git a/src/plugins/data/common/search/tabify/tabify_docs.ts b/src/plugins/data/common/search/tabify/tabify_docs.ts index cfc1d21129df1..8e628e7741df5 100644 --- a/src/plugins/data/common/search/tabify/tabify_docs.ts +++ b/src/plugins/data/common/search/tabify/tabify_docs.ts @@ -8,7 +8,7 @@ import type { estypes } from '@elastic/elasticsearch'; import { isPlainObject } from 'lodash'; -import { IndexPattern } from '../../index_patterns/index_patterns'; +import { IndexPattern } from '../..'; import { Datatable, DatatableColumn, DatatableColumnType } from '../../../../expressions/common'; export interface TabifyDocsOptions { diff --git a/src/plugins/data/common/stubs.ts b/src/plugins/data/common/stubs.ts index 48310d8653a16..36bd3357e7098 100644 --- a/src/plugins/data/common/stubs.ts +++ b/src/plugins/data/common/stubs.ts @@ -6,6 +6,6 @@ * Side Public License, v 1. */ -export * from './index_patterns/field.stub'; -export * from './index_patterns/index_pattern.stub'; +export * from './data_views/field.stub'; +export * from './data_views/index_pattern.stub'; export * from './es_query/stubs'; diff --git a/src/plugins/data/common/types.ts b/src/plugins/data/common/types.ts index 7f6ae4a346bd0..c574d4854cfd6 100644 --- a/src/plugins/data/common/types.ts +++ b/src/plugins/data/common/types.ts @@ -8,7 +8,7 @@ export * from './query/types'; export * from './kbn_field_types/types'; -export * from './index_patterns/types'; +export * from './data_views/types'; /** * If a service is being shared on both the client and the server, and diff --git a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts b/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts index ebd90c7e92d75..0cb229c9b41bc 100644 --- a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts +++ b/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts @@ -7,7 +7,7 @@ */ import { ValueSuggestionsMethod } from '../../../common'; -import { IFieldType, IIndexPattern } from '../../../common/index_patterns'; +import { IFieldType, IIndexPattern } from '../../../common'; export enum QuerySuggestionTypes { Field = 'field', diff --git a/src/plugins/data/public/index_patterns/index_patterns/index.ts b/src/plugins/data/public/data_views/data_views/index.ts similarity index 88% rename from src/plugins/data/public/index_patterns/index_patterns/index.ts rename to src/plugins/data/public/data_views/data_views/index.ts index 9c6770b5b2e71..3c15538a7a2e9 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index.ts +++ b/src/plugins/data/public/data_views/data_views/index.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -export * from '../../../common/index_patterns/index_patterns'; +export * from '../../../common/data_views/data_views'; export * from './redirect_no_index_pattern'; export * from './on_unsupported_time_pattern'; export * from './index_patterns_api_client'; diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_pattern.stub.ts b/src/plugins/data/public/data_views/data_views/index_pattern.stub.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/index_pattern.stub.ts rename to src/plugins/data/public/data_views/data_views/index_pattern.stub.ts diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.mock.ts b/src/plugins/data/public/data_views/data_views/index_patterns_api_client.test.mock.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.mock.ts rename to src/plugins/data/public/data_views/data_views/index_patterns_api_client.test.mock.ts diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.ts b/src/plugins/data/public/data_views/data_views/index_patterns_api_client.test.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.ts rename to src/plugins/data/public/data_views/data_views/index_patterns_api_client.test.ts diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts b/src/plugins/data/public/data_views/data_views/index_patterns_api_client.ts similarity index 94% rename from src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts rename to src/plugins/data/public/data_views/data_views/index_patterns_api_client.ts index b3471f0630390..295cd99e7e017 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts +++ b/src/plugins/data/public/data_views/data_views/index_patterns_api_client.ts @@ -7,12 +7,12 @@ */ import { HttpSetup } from 'src/core/public'; -import { DataViewMissingIndices } from '../../../common/index_patterns/lib'; +import { DataViewMissingIndices } from '../../../common/data_views/lib'; import { GetFieldsOptions, IIndexPatternsApiClient, GetFieldsOptionsTimePattern, -} from '../../../common/index_patterns/types'; +} from '../../../common/data_views/types'; const API_BASE_URL: string = `/api/index_patterns/`; diff --git a/src/plugins/data/public/index_patterns/index_patterns/on_unsupported_time_pattern.tsx b/src/plugins/data/public/data_views/data_views/on_unsupported_time_pattern.tsx similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/on_unsupported_time_pattern.tsx rename to src/plugins/data/public/data_views/data_views/on_unsupported_time_pattern.tsx diff --git a/src/plugins/data/public/index_patterns/index_patterns/redirect_no_index_pattern.tsx b/src/plugins/data/public/data_views/data_views/redirect_no_index_pattern.tsx similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/redirect_no_index_pattern.tsx rename to src/plugins/data/public/data_views/data_views/redirect_no_index_pattern.tsx diff --git a/src/plugins/data/public/index_patterns/expressions/index.ts b/src/plugins/data/public/data_views/expressions/index.ts similarity index 100% rename from src/plugins/data/public/index_patterns/expressions/index.ts rename to src/plugins/data/public/data_views/expressions/index.ts diff --git a/src/plugins/data/public/index_patterns/expressions/load_index_pattern.test.ts b/src/plugins/data/public/data_views/expressions/load_index_pattern.test.ts similarity index 97% rename from src/plugins/data/public/index_patterns/expressions/load_index_pattern.test.ts rename to src/plugins/data/public/data_views/expressions/load_index_pattern.test.ts index 399fe6669544b..befa78c398984 100644 --- a/src/plugins/data/public/index_patterns/expressions/load_index_pattern.test.ts +++ b/src/plugins/data/public/data_views/expressions/load_index_pattern.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPatternLoadStartDependencies } from '../../../common/index_patterns/expressions'; +import { IndexPatternLoadStartDependencies } from '../../../common/data_views/expressions'; import { getFunctionDefinition } from './load_index_pattern'; describe('indexPattern expression function', () => { diff --git a/src/plugins/data/public/index_patterns/expressions/load_index_pattern.ts b/src/plugins/data/public/data_views/expressions/load_index_pattern.ts similarity index 97% rename from src/plugins/data/public/index_patterns/expressions/load_index_pattern.ts rename to src/plugins/data/public/data_views/expressions/load_index_pattern.ts index d92c1dc9828e1..979861c7da38e 100644 --- a/src/plugins/data/public/index_patterns/expressions/load_index_pattern.ts +++ b/src/plugins/data/public/data_views/expressions/load_index_pattern.ts @@ -11,7 +11,7 @@ import { getIndexPatternLoadMeta, IndexPatternLoadExpressionFunctionDefinition, IndexPatternLoadStartDependencies, -} from '../../../common/index_patterns/expressions'; +} from '../../../common/data_views/expressions'; import { DataPublicPluginStart, DataStartDependencies } from '../../types'; /** diff --git a/src/plugins/data/public/index_patterns/index.ts b/src/plugins/data/public/data_views/index.ts similarity index 88% rename from src/plugins/data/public/index_patterns/index.ts rename to src/plugins/data/public/data_views/index.ts index 7271e27c5fe62..587c866c23291 100644 --- a/src/plugins/data/public/index_patterns/index.ts +++ b/src/plugins/data/public/data_views/index.ts @@ -13,15 +13,15 @@ export { ILLEGAL_CHARACTERS, validateDataView, isDefault, -} from '../../common/index_patterns/lib'; +} from '../../common/data_views/lib'; export { flattenHitWrapper, formatHitProvider, onRedirectNoIndexPattern, onUnsupportedTimePattern, -} from './index_patterns'; +} from './data_views'; -export { IndexPatternField, IIndexPatternFieldList, TypeMeta } from '../../common/index_patterns'; +export { IndexPatternField, IIndexPatternFieldList, TypeMeta } from '../../common/data_views'; export { IndexPatternsService, @@ -31,6 +31,6 @@ export { DataViewsService, DataViewsContract, DataView, -} from './index_patterns'; +} from './data_views'; export { UiSettingsPublicToCommon } from './ui_settings_wrapper'; export { SavedObjectsClientPublicToCommon } from './saved_objects_client_wrapper'; diff --git a/src/plugins/data/public/index_patterns/saved_objects_client_wrapper.ts b/src/plugins/data/public/data_views/saved_objects_client_wrapper.ts similarity index 98% rename from src/plugins/data/public/index_patterns/saved_objects_client_wrapper.ts rename to src/plugins/data/public/data_views/saved_objects_client_wrapper.ts index fe3a2e67577e5..c8e633c6ec878 100644 --- a/src/plugins/data/public/index_patterns/saved_objects_client_wrapper.ts +++ b/src/plugins/data/public/data_views/saved_objects_client_wrapper.ts @@ -12,7 +12,7 @@ import { SavedObjectsClientCommon, SavedObjectsClientCommonFindArgs, SavedObject, -} from '../../common/index_patterns'; +} from '../../common/data_views'; type SOClient = Pick; diff --git a/src/plugins/data/public/index_patterns/ui_settings_wrapper.ts b/src/plugins/data/public/data_views/ui_settings_wrapper.ts similarity index 93% rename from src/plugins/data/public/index_patterns/ui_settings_wrapper.ts rename to src/plugins/data/public/data_views/ui_settings_wrapper.ts index e9209e0aa6091..e0998ed72b2e6 100644 --- a/src/plugins/data/public/index_patterns/ui_settings_wrapper.ts +++ b/src/plugins/data/public/data_views/ui_settings_wrapper.ts @@ -7,7 +7,7 @@ */ import { IUiSettingsClient } from 'src/core/public'; -import { UiSettingsCommon } from '../../common/index_patterns'; +import { UiSettingsCommon } from '../../common'; export class UiSettingsPublicToCommon implements UiSettingsCommon { private uiSettings: IUiSettingsClient; diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index 595a88b412e9f..6480a0a340340 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -48,9 +48,9 @@ import { isDefault, validateDataView, flattenHitWrapper, -} from './index_patterns'; +} from './data_views'; -export type { IndexPatternsService } from './index_patterns'; +export type { IndexPatternsService } from './data_views'; // Index patterns namespace: export const indexPatterns = { @@ -71,7 +71,7 @@ export { IndexPattern, IndexPatternField, TypeMeta, -} from './index_patterns'; +} from './data_views'; export { IIndexPattern, @@ -91,7 +91,7 @@ export { IndexPatternListItem, } from '../common'; -export { DuplicateDataViewError } from '../common/index_patterns/errors'; +export { DuplicateDataViewError } from '../common/data_views/errors'; /* * Autocomplete query suggestions: diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index 42c4c8897f746..7af8d8eed31cf 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -27,7 +27,7 @@ import { onUnsupportedTimePattern, IndexPatternsApiClient, UiSettingsPublicToCommon, -} from './index_patterns'; +} from './data_views'; import { setIndexPatterns, setNotifications, @@ -45,8 +45,8 @@ import { createSelectRangeAction, } from './actions'; import { APPLY_FILTER_TRIGGER, applyFilterTrigger } from './triggers'; -import { SavedObjectsClientPublicToCommon } from './index_patterns'; -import { getIndexPatternLoad } from './index_patterns/expressions'; +import { SavedObjectsClientPublicToCommon } from './data_views'; +import { getIndexPatternLoad } from './data_views/expressions'; import { UsageCollectionSetup } from '../../usage_collection/public'; import { getTableViewDescription } from './utils/table_inspector_view'; import { NowProvider, NowProviderInternalContract } from './now_provider'; diff --git a/src/plugins/data/public/search/aggs/aggs_service.ts b/src/plugins/data/public/search/aggs/aggs_service.ts index 3f91ced6de950..4907c3bcbad26 100644 --- a/src/plugins/data/public/search/aggs/aggs_service.ts +++ b/src/plugins/data/public/search/aggs/aggs_service.ts @@ -20,7 +20,7 @@ import { AggTypesDependencies, } from '../../../common/search/aggs'; import { AggsSetup, AggsStart } from './types'; -import { IndexPatternsContract } from '../../index_patterns'; +import { IndexPatternsContract } from '../..'; import { NowProviderInternalContract } from '../../now_provider'; /** diff --git a/src/plugins/data/public/search/expressions/esaggs.test.ts b/src/plugins/data/public/search/expressions/esaggs.test.ts index e43069697f6eb..fa9e2755e529c 100644 --- a/src/plugins/data/public/search/expressions/esaggs.test.ts +++ b/src/plugins/data/public/search/expressions/esaggs.test.ts @@ -10,7 +10,7 @@ import { omit } from 'lodash'; import { of as mockOf } from 'rxjs'; import type { MockedKeys } from '@kbn/utility-types/jest'; import type { ExecutionContext } from 'src/plugins/expressions/public'; -import type { IndexPatternsContract } from '../../../common/index_patterns/index_patterns'; +import type { IndexPatternsContract } from '../../../common'; import type { ISearchStartSearchSource, KibanaContext, diff --git a/src/plugins/data/public/search/expressions/esdsl.ts b/src/plugins/data/public/search/expressions/esdsl.ts index 1dda44ee8993e..c03226542ef7a 100644 --- a/src/plugins/data/public/search/expressions/esdsl.ts +++ b/src/plugins/data/public/search/expressions/esdsl.ts @@ -9,7 +9,7 @@ import { StartServicesAccessor } from 'src/core/public'; import { DataPublicPluginStart, DataStartDependencies } from '../../types'; import { getEsdslFn } from '../../../common/search/expressions/esdsl'; -import { UiSettingsCommon } from '../../../common/index_patterns'; +import { UiSettingsCommon } from '../../../common'; /** * This is some glue code that takes in `core.getStartServices`, extracts the dependencies diff --git a/src/plugins/data/public/search/expressions/kibana_context.ts b/src/plugins/data/public/search/expressions/kibana_context.ts index e7ce8edf3080a..cb6e5369eb34a 100644 --- a/src/plugins/data/public/search/expressions/kibana_context.ts +++ b/src/plugins/data/public/search/expressions/kibana_context.ts @@ -9,7 +9,7 @@ import { StartServicesAccessor } from 'src/core/public'; import { getKibanaContextFn } from '../../../common/search/expressions'; import { DataPublicPluginStart, DataStartDependencies } from '../../types'; -import { SavedObjectsClientCommon } from '../../../common/index_patterns'; +import { SavedObjectsClientCommon } from '../../../common'; /** * This is some glue code that takes in `core.getStartServices`, extracts the dependencies diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index 3baf41875ed98..7cba1ec17c322 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -44,7 +44,7 @@ import { esRawResponse, } from '../../common/search'; import { AggsService, AggsStartDependencies } from './aggs'; -import { IndexPatternsContract } from '../index_patterns/index_patterns'; +import { IndexPatternsContract } from '..'; import { ISearchInterceptor, SearchInterceptor } from './search_interceptor'; import { SearchUsageCollector, createUsageCollector } from './collectors'; import { UsageCollectionSetup } from '../../../usage_collection/public'; diff --git a/src/plugins/data/public/search/types.ts b/src/plugins/data/public/search/types.ts index 8190c52b5c0c5..764933d15e065 100644 --- a/src/plugins/data/public/search/types.ts +++ b/src/plugins/data/public/search/types.ts @@ -10,7 +10,7 @@ import { PackageInfo } from 'kibana/server'; import { SearchUsageCollector } from './collectors'; import { AggsSetup, AggsSetupDependencies, AggsStartDependencies, AggsStart } from './aggs'; import { ISearchGeneric, ISearchStartSearchSource } from '../../common/search'; -import { IndexPatternsContract } from '../../common/index_patterns/index_patterns'; +import { IndexPatternsContract } from '../../common'; import { UsageCollectionSetup } from '../../../usage_collection/public'; import { ISessionsClient, ISessionService } from './session'; diff --git a/src/plugins/data/public/services.ts b/src/plugins/data/public/services.ts index b6306831a2692..bcc23e13a1ec6 100644 --- a/src/plugins/data/public/services.ts +++ b/src/plugins/data/public/services.ts @@ -8,7 +8,7 @@ import { NotificationsStart, CoreStart } from 'src/core/public'; import { createGetterSetter } from '../../kibana_utils/public'; -import { IndexPatternsContract } from './index_patterns'; +import { IndexPatternsContract } from './data_views'; import { DataPublicPluginStart } from './types'; export const [getNotifications, setNotifications] = createGetterSetter( diff --git a/src/plugins/data/public/stubs.ts b/src/plugins/data/public/stubs.ts index 2a09a37999712..8e790a2991b05 100644 --- a/src/plugins/data/public/stubs.ts +++ b/src/plugins/data/public/stubs.ts @@ -7,4 +7,4 @@ */ export * from '../common/stubs'; -export { createStubIndexPattern } from './index_patterns/index_patterns/index_pattern.stub'; +export { createStubIndexPattern } from './data_views/data_views/index_pattern.stub'; diff --git a/src/plugins/data/public/types.ts b/src/plugins/data/public/types.ts index b31a4ab933ae2..7ed13c2096515 100644 --- a/src/plugins/data/public/types.ts +++ b/src/plugins/data/public/types.ts @@ -17,7 +17,7 @@ import { AutocompleteSetup, AutocompleteStart } from './autocomplete'; import { createFiltersFromRangeSelectAction, createFiltersFromValueClickAction } from './actions'; import { ISearchSetup, ISearchStart } from './search'; import { QuerySetup, QueryStart } from './query'; -import { DataViewsContract } from './index_patterns'; +import { DataViewsContract } from './data_views'; import { IndexPatternSelectProps, StatefulSearchBarProps } from './ui'; import { UsageCollectionSetup, UsageCollectionStart } from '../../usage_collection/public'; import { Setup as InspectorSetup } from '../../inspector/public'; diff --git a/src/plugins/data/server/autocomplete/terms_agg.test.ts b/src/plugins/data/server/autocomplete/terms_agg.test.ts index 820ec445a22ca..96a75fd3b2fd8 100644 --- a/src/plugins/data/server/autocomplete/terms_agg.test.ts +++ b/src/plugins/data/server/autocomplete/terms_agg.test.ts @@ -34,7 +34,7 @@ const mockResponse = { }, } as ApiResponse>; -jest.mock('../index_patterns'); +jest.mock('../data_views'); describe('terms agg suggestions', () => { beforeEach(() => { diff --git a/src/plugins/data/server/autocomplete/terms_agg.ts b/src/plugins/data/server/autocomplete/terms_agg.ts index b902bae49898f..9b1f5d92889bc 100644 --- a/src/plugins/data/server/autocomplete/terms_agg.ts +++ b/src/plugins/data/server/autocomplete/terms_agg.ts @@ -11,7 +11,7 @@ import { ElasticsearchClient, SavedObjectsClientContract } from 'kibana/server'; import { estypes } from '@elastic/elasticsearch'; import { ConfigSchema } from '../../config'; import { IFieldType } from '../../common'; -import { findIndexPatternById, getFieldByName } from '../index_patterns'; +import { findIndexPatternById, getFieldByName } from '../data_views'; import { shimAbortSignal } from '../search'; export async function termsAggSuggestions( diff --git a/src/plugins/data/server/autocomplete/terms_enum.test.ts b/src/plugins/data/server/autocomplete/terms_enum.test.ts index 4e1eecc71db7c..0e00e2dfe6b4f 100644 --- a/src/plugins/data/server/autocomplete/terms_enum.test.ts +++ b/src/plugins/data/server/autocomplete/terms_enum.test.ts @@ -23,7 +23,7 @@ const mockResponse = { body: { terms: ['whoa', 'amazing'] }, }; -jest.mock('../index_patterns'); +jest.mock('../data_views'); describe('_terms_enum suggestions', () => { beforeEach(() => { diff --git a/src/plugins/data/server/autocomplete/terms_enum.ts b/src/plugins/data/server/autocomplete/terms_enum.ts index 4bfd1545c6fe5..3d7f369233720 100644 --- a/src/plugins/data/server/autocomplete/terms_enum.ts +++ b/src/plugins/data/server/autocomplete/terms_enum.ts @@ -9,7 +9,7 @@ import { ElasticsearchClient, SavedObjectsClientContract } from 'kibana/server'; import { estypes } from '@elastic/elasticsearch'; import { IFieldType } from '../../common'; -import { findIndexPatternById, getFieldByName } from '../index_patterns'; +import { findIndexPatternById, getFieldByName } from '../data_views'; import { shimAbortSignal } from '../search'; import { ConfigSchema } from '../../config'; diff --git a/src/plugins/data/server/index_patterns/capabilities_provider.ts b/src/plugins/data/server/data_views/capabilities_provider.ts similarity index 100% rename from src/plugins/data/server/index_patterns/capabilities_provider.ts rename to src/plugins/data/server/data_views/capabilities_provider.ts diff --git a/src/plugins/data/server/index_patterns/deprecations/index.ts b/src/plugins/data/server/data_views/deprecations/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/deprecations/index.ts rename to src/plugins/data/server/data_views/deprecations/index.ts diff --git a/src/plugins/data/server/index_patterns/deprecations/scripted_fields.test.ts b/src/plugins/data/server/data_views/deprecations/scripted_fields.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/deprecations/scripted_fields.test.ts rename to src/plugins/data/server/data_views/deprecations/scripted_fields.test.ts diff --git a/src/plugins/data/server/index_patterns/deprecations/scripted_fields.ts b/src/plugins/data/server/data_views/deprecations/scripted_fields.ts similarity index 100% rename from src/plugins/data/server/index_patterns/deprecations/scripted_fields.ts rename to src/plugins/data/server/data_views/deprecations/scripted_fields.ts diff --git a/src/plugins/data/server/index_patterns/error.ts b/src/plugins/data/server/data_views/error.ts similarity index 100% rename from src/plugins/data/server/index_patterns/error.ts rename to src/plugins/data/server/data_views/error.ts diff --git a/src/plugins/data/server/index_patterns/expressions/index.ts b/src/plugins/data/server/data_views/expressions/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/expressions/index.ts rename to src/plugins/data/server/data_views/expressions/index.ts diff --git a/src/plugins/data/server/index_patterns/expressions/load_index_pattern.test.ts b/src/plugins/data/server/data_views/expressions/load_index_pattern.test.ts similarity index 98% rename from src/plugins/data/server/index_patterns/expressions/load_index_pattern.test.ts rename to src/plugins/data/server/data_views/expressions/load_index_pattern.test.ts index 998640bda8848..370d7dcfd7eba 100644 --- a/src/plugins/data/server/index_patterns/expressions/load_index_pattern.test.ts +++ b/src/plugins/data/server/data_views/expressions/load_index_pattern.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPatternLoadStartDependencies } from '../../../common/index_patterns/expressions'; +import { IndexPatternLoadStartDependencies } from '../../../common/data_views/expressions'; import { getFunctionDefinition } from './load_index_pattern'; describe('indexPattern expression function', () => { diff --git a/src/plugins/data/server/index_patterns/expressions/load_index_pattern.ts b/src/plugins/data/server/data_views/expressions/load_index_pattern.ts similarity index 98% rename from src/plugins/data/server/index_patterns/expressions/load_index_pattern.ts rename to src/plugins/data/server/data_views/expressions/load_index_pattern.ts index 9112686c568da..4585101f2812c 100644 --- a/src/plugins/data/server/index_patterns/expressions/load_index_pattern.ts +++ b/src/plugins/data/server/data_views/expressions/load_index_pattern.ts @@ -13,7 +13,7 @@ import { getIndexPatternLoadMeta, IndexPatternLoadExpressionFunctionDefinition, IndexPatternLoadStartDependencies, -} from '../../../common/index_patterns/expressions'; +} from '../../../common/data_views/expressions'; import { DataPluginStartDependencies, DataPluginStart } from '../../plugin'; /** diff --git a/src/plugins/data/server/index_patterns/fetcher/index.ts b/src/plugins/data/server/data_views/fetcher/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/index.ts rename to src/plugins/data/server/data_views/fetcher/index.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.test.ts b/src/plugins/data/server/data_views/fetcher/index_patterns_fetcher.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.test.ts rename to src/plugins/data/server/data_views/fetcher/index_patterns_fetcher.test.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.ts b/src/plugins/data/server/data_views/fetcher/index_patterns_fetcher.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.ts rename to src/plugins/data/server/data_views/fetcher/index_patterns_fetcher.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/errors.ts b/src/plugins/data/server/data_views/fetcher/lib/errors.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/errors.ts rename to src/plugins/data/server/data_views/fetcher/lib/errors.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/es_api.test.js b/src/plugins/data/server/data_views/fetcher/lib/es_api.test.js similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/es_api.test.js rename to src/plugins/data/server/data_views/fetcher/lib/es_api.test.js diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/es_api.ts b/src/plugins/data/server/data_views/fetcher/lib/es_api.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/es_api.ts rename to src/plugins/data/server/data_views/fetcher/lib/es_api.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/__fixtures__/es_field_caps_response.json b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/__fixtures__/es_field_caps_response.json similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/__fixtures__/es_field_caps_response.json rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/__fixtures__/es_field_caps_response.json diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_capabilities.test.js b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_capabilities.test.js similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_capabilities.test.js rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_capabilities.test.js diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_capabilities.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_capabilities.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_capabilities.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_capabilities.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.test.js b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_caps_response.test.js similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.test.js rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_caps_response.test.js diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_caps_response.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_caps_response.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/index.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/index.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/index.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/overrides.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/overrides.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/overrides.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/overrides.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/should_read_field_from_doc_values.test.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/should_read_field_from_doc_values.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/should_read_field_from_doc_values.test.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/should_read_field_from_doc_values.test.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/should_read_field_from_doc_values.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/should_read_field_from_doc_values.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/should_read_field_from_doc_values.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/should_read_field_from_doc_values.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/index.ts b/src/plugins/data/server/data_views/fetcher/lib/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/index.ts rename to src/plugins/data/server/data_views/fetcher/lib/index.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/jobs_compatibility.test.js b/src/plugins/data/server/data_views/fetcher/lib/jobs_compatibility.test.js similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/jobs_compatibility.test.js rename to src/plugins/data/server/data_views/fetcher/lib/jobs_compatibility.test.js diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/jobs_compatibility.ts b/src/plugins/data/server/data_views/fetcher/lib/jobs_compatibility.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/jobs_compatibility.ts rename to src/plugins/data/server/data_views/fetcher/lib/jobs_compatibility.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/map_capabilities.ts b/src/plugins/data/server/data_views/fetcher/lib/map_capabilities.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/map_capabilities.ts rename to src/plugins/data/server/data_views/fetcher/lib/map_capabilities.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/merge_capabilities_with_fields.ts b/src/plugins/data/server/data_views/fetcher/lib/merge_capabilities_with_fields.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/merge_capabilities_with_fields.ts rename to src/plugins/data/server/data_views/fetcher/lib/merge_capabilities_with_fields.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/resolve_time_pattern.test.js b/src/plugins/data/server/data_views/fetcher/lib/resolve_time_pattern.test.js similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/resolve_time_pattern.test.js rename to src/plugins/data/server/data_views/fetcher/lib/resolve_time_pattern.test.js diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/resolve_time_pattern.ts b/src/plugins/data/server/data_views/fetcher/lib/resolve_time_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/resolve_time_pattern.ts rename to src/plugins/data/server/data_views/fetcher/lib/resolve_time_pattern.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/time_pattern_to_wildcard.test.ts b/src/plugins/data/server/data_views/fetcher/lib/time_pattern_to_wildcard.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/time_pattern_to_wildcard.test.ts rename to src/plugins/data/server/data_views/fetcher/lib/time_pattern_to_wildcard.test.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/time_pattern_to_wildcard.ts b/src/plugins/data/server/data_views/fetcher/lib/time_pattern_to_wildcard.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/time_pattern_to_wildcard.ts rename to src/plugins/data/server/data_views/fetcher/lib/time_pattern_to_wildcard.ts diff --git a/src/plugins/data/server/index_patterns/has_user_index_pattern.test.ts b/src/plugins/data/server/data_views/has_user_index_pattern.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/has_user_index_pattern.test.ts rename to src/plugins/data/server/data_views/has_user_index_pattern.test.ts diff --git a/src/plugins/data/server/index_patterns/has_user_index_pattern.ts b/src/plugins/data/server/data_views/has_user_index_pattern.ts similarity index 92% rename from src/plugins/data/server/index_patterns/has_user_index_pattern.ts rename to src/plugins/data/server/data_views/has_user_index_pattern.ts index b65983a7fd5d4..97abd0892b836 100644 --- a/src/plugins/data/server/index_patterns/has_user_index_pattern.ts +++ b/src/plugins/data/server/data_views/has_user_index_pattern.ts @@ -7,8 +7,8 @@ */ import { ElasticsearchClient, SavedObjectsClientContract } from '../../../../core/server'; -import { IndexPatternSavedObjectAttrs } from '../../common/index_patterns/index_patterns'; -import { FLEET_ASSETS_TO_IGNORE } from '../../common/index_patterns/constants'; +import { IndexPatternSavedObjectAttrs } from '../../common/data_views/data_views'; +import { FLEET_ASSETS_TO_IGNORE } from '../../common/data_views/constants'; interface Deps { esClient: ElasticsearchClient; diff --git a/src/plugins/data/server/index_patterns/index.ts b/src/plugins/data/server/data_views/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/index.ts rename to src/plugins/data/server/data_views/index.ts diff --git a/src/plugins/data/server/index_patterns/index_patterns_api_client.ts b/src/plugins/data/server/data_views/index_patterns_api_client.ts similarity index 94% rename from src/plugins/data/server/index_patterns/index_patterns_api_client.ts rename to src/plugins/data/server/data_views/index_patterns_api_client.ts index eeb146aee46a3..4f71bf218dd4d 100644 --- a/src/plugins/data/server/index_patterns/index_patterns_api_client.ts +++ b/src/plugins/data/server/data_views/index_patterns_api_client.ts @@ -11,8 +11,8 @@ import { GetFieldsOptions, IIndexPatternsApiClient, GetFieldsOptionsTimePattern, -} from '../../common/index_patterns/types'; -import { DataViewMissingIndices } from '../../common/index_patterns/lib'; +} from '../../common/data_views/types'; +import { DataViewMissingIndices } from '../../common/data_views/lib'; import { IndexPatternsFetcher } from './fetcher'; import { hasUserIndexPattern } from './has_user_index_pattern'; diff --git a/src/plugins/data/server/index_patterns/index_patterns_service.ts b/src/plugins/data/server/data_views/index_patterns_service.ts similarity index 100% rename from src/plugins/data/server/index_patterns/index_patterns_service.ts rename to src/plugins/data/server/data_views/index_patterns_service.ts diff --git a/src/plugins/data/server/index_patterns/mocks.ts b/src/plugins/data/server/data_views/mocks.ts similarity index 100% rename from src/plugins/data/server/index_patterns/mocks.ts rename to src/plugins/data/server/data_views/mocks.ts diff --git a/src/plugins/data/server/index_patterns/register_index_pattern_usage_collection.test.ts b/src/plugins/data/server/data_views/register_index_pattern_usage_collection.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/register_index_pattern_usage_collection.test.ts rename to src/plugins/data/server/data_views/register_index_pattern_usage_collection.test.ts diff --git a/src/plugins/data/server/index_patterns/register_index_pattern_usage_collection.ts b/src/plugins/data/server/data_views/register_index_pattern_usage_collection.ts similarity index 100% rename from src/plugins/data/server/index_patterns/register_index_pattern_usage_collection.ts rename to src/plugins/data/server/data_views/register_index_pattern_usage_collection.ts diff --git a/src/plugins/data/server/index_patterns/routes.ts b/src/plugins/data/server/data_views/routes.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes.ts rename to src/plugins/data/server/data_views/routes.ts diff --git a/src/plugins/data/server/index_patterns/routes/create_index_pattern.ts b/src/plugins/data/server/data_views/routes/create_index_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/create_index_pattern.ts rename to src/plugins/data/server/data_views/routes/create_index_pattern.ts diff --git a/src/plugins/data/server/index_patterns/routes/default_index_pattern.ts b/src/plugins/data/server/data_views/routes/default_index_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/default_index_pattern.ts rename to src/plugins/data/server/data_views/routes/default_index_pattern.ts diff --git a/src/plugins/data/server/index_patterns/routes/delete_index_pattern.ts b/src/plugins/data/server/data_views/routes/delete_index_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/delete_index_pattern.ts rename to src/plugins/data/server/data_views/routes/delete_index_pattern.ts diff --git a/src/plugins/data/server/index_patterns/routes/fields/update_fields.ts b/src/plugins/data/server/data_views/routes/fields/update_fields.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/fields/update_fields.ts rename to src/plugins/data/server/data_views/routes/fields/update_fields.ts diff --git a/src/plugins/data/server/index_patterns/routes/get_index_pattern.ts b/src/plugins/data/server/data_views/routes/get_index_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/get_index_pattern.ts rename to src/plugins/data/server/data_views/routes/get_index_pattern.ts diff --git a/src/plugins/data/server/index_patterns/routes/has_user_index_pattern.ts b/src/plugins/data/server/data_views/routes/has_user_index_pattern.ts similarity index 95% rename from src/plugins/data/server/index_patterns/routes/has_user_index_pattern.ts rename to src/plugins/data/server/data_views/routes/has_user_index_pattern.ts index 6447f50f88f26..7d67e96f39f6e 100644 --- a/src/plugins/data/server/index_patterns/routes/has_user_index_pattern.ts +++ b/src/plugins/data/server/data_views/routes/has_user_index_pattern.ts @@ -31,7 +31,7 @@ export const registerHasUserIndexPatternRoute = ( return res.ok({ body: { - result: await indexPatternsService.hasUserIndexPattern(), + result: await indexPatternsService.hasUserDataView(), }, }); }) diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/create_runtime_field.ts b/src/plugins/data/server/data_views/routes/runtime_fields/create_runtime_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/runtime_fields/create_runtime_field.ts rename to src/plugins/data/server/data_views/routes/runtime_fields/create_runtime_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/delete_runtime_field.ts b/src/plugins/data/server/data_views/routes/runtime_fields/delete_runtime_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/runtime_fields/delete_runtime_field.ts rename to src/plugins/data/server/data_views/routes/runtime_fields/delete_runtime_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/get_runtime_field.ts b/src/plugins/data/server/data_views/routes/runtime_fields/get_runtime_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/runtime_fields/get_runtime_field.ts rename to src/plugins/data/server/data_views/routes/runtime_fields/get_runtime_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/put_runtime_field.ts b/src/plugins/data/server/data_views/routes/runtime_fields/put_runtime_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/runtime_fields/put_runtime_field.ts rename to src/plugins/data/server/data_views/routes/runtime_fields/put_runtime_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/update_runtime_field.ts b/src/plugins/data/server/data_views/routes/runtime_fields/update_runtime_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/runtime_fields/update_runtime_field.ts rename to src/plugins/data/server/data_views/routes/runtime_fields/update_runtime_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/scripted_fields/create_scripted_field.ts b/src/plugins/data/server/data_views/routes/scripted_fields/create_scripted_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/scripted_fields/create_scripted_field.ts rename to src/plugins/data/server/data_views/routes/scripted_fields/create_scripted_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/scripted_fields/delete_scripted_field.ts b/src/plugins/data/server/data_views/routes/scripted_fields/delete_scripted_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/scripted_fields/delete_scripted_field.ts rename to src/plugins/data/server/data_views/routes/scripted_fields/delete_scripted_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/scripted_fields/get_scripted_field.ts b/src/plugins/data/server/data_views/routes/scripted_fields/get_scripted_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/scripted_fields/get_scripted_field.ts rename to src/plugins/data/server/data_views/routes/scripted_fields/get_scripted_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/scripted_fields/put_scripted_field.ts b/src/plugins/data/server/data_views/routes/scripted_fields/put_scripted_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/scripted_fields/put_scripted_field.ts rename to src/plugins/data/server/data_views/routes/scripted_fields/put_scripted_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/scripted_fields/update_scripted_field.ts b/src/plugins/data/server/data_views/routes/scripted_fields/update_scripted_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/scripted_fields/update_scripted_field.ts rename to src/plugins/data/server/data_views/routes/scripted_fields/update_scripted_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/update_index_pattern.ts b/src/plugins/data/server/data_views/routes/update_index_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/update_index_pattern.ts rename to src/plugins/data/server/data_views/routes/update_index_pattern.ts diff --git a/src/plugins/data/server/index_patterns/routes/util/handle_errors.ts b/src/plugins/data/server/data_views/routes/util/handle_errors.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/util/handle_errors.ts rename to src/plugins/data/server/data_views/routes/util/handle_errors.ts diff --git a/src/plugins/data/server/index_patterns/routes/util/schemas.ts b/src/plugins/data/server/data_views/routes/util/schemas.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/util/schemas.ts rename to src/plugins/data/server/data_views/routes/util/schemas.ts diff --git a/src/plugins/data/server/index_patterns/saved_objects_client_wrapper.ts b/src/plugins/data/server/data_views/saved_objects_client_wrapper.ts similarity index 97% rename from src/plugins/data/server/index_patterns/saved_objects_client_wrapper.ts rename to src/plugins/data/server/data_views/saved_objects_client_wrapper.ts index de78812bc08aa..034f59aa52568 100644 --- a/src/plugins/data/server/index_patterns/saved_objects_client_wrapper.ts +++ b/src/plugins/data/server/data_views/saved_objects_client_wrapper.ts @@ -10,7 +10,7 @@ import { SavedObjectsClientContract, SavedObject } from 'src/core/server'; import { SavedObjectsClientCommon, SavedObjectsClientCommonFindArgs, -} from '../../common/index_patterns'; +} from '../../common/data_views'; export class SavedObjectsClientServerToCommon implements SavedObjectsClientCommon { private savedObjectClient: SavedObjectsClientContract; diff --git a/src/plugins/data/server/index_patterns/ui_settings_wrapper.ts b/src/plugins/data/server/data_views/ui_settings_wrapper.ts similarity index 93% rename from src/plugins/data/server/index_patterns/ui_settings_wrapper.ts rename to src/plugins/data/server/data_views/ui_settings_wrapper.ts index bb7332dc45476..3b00aab7d6bdd 100644 --- a/src/plugins/data/server/index_patterns/ui_settings_wrapper.ts +++ b/src/plugins/data/server/data_views/ui_settings_wrapper.ts @@ -7,7 +7,7 @@ */ import { IUiSettingsClient } from 'src/core/server'; -import { UiSettingsCommon } from '../../common/index_patterns'; +import { UiSettingsCommon } from '../../common'; export class UiSettingsServerToCommon implements UiSettingsCommon { private uiSettings: IUiSettingsClient; diff --git a/src/plugins/data/server/index_patterns/utils.ts b/src/plugins/data/server/data_views/utils.ts similarity index 100% rename from src/plugins/data/server/index_patterns/utils.ts rename to src/plugins/data/server/data_views/utils.ts diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts index 7a8dfc48e395a..9d2e94bcf15c0 100644 --- a/src/plugins/data/server/index.ts +++ b/src/plugins/data/server/index.ts @@ -42,7 +42,7 @@ export { FieldDescriptor, getCapabilitiesForRollupIndices, IndexPatternsServiceStart, -} from './index_patterns'; +} from './data_views'; export { IndexPatternField, diff --git a/src/plugins/data/server/mocks.ts b/src/plugins/data/server/mocks.ts index af104dea72af7..852dffcfa3d51 100644 --- a/src/plugins/data/server/mocks.ts +++ b/src/plugins/data/server/mocks.ts @@ -15,7 +15,7 @@ import { createFieldFormatsSetupMock, createFieldFormatsStartMock, } from '../../field_formats/server/mocks'; -import { createIndexPatternsStartMock } from './index_patterns/mocks'; +import { createIndexPatternsStartMock } from './data_views/mocks'; import { DataRequestHandlerContext } from './search'; function createSetupContract() { diff --git a/src/plugins/data/server/plugin.ts b/src/plugins/data/server/plugin.ts index e04095ed26a46..c1741cc31fc05 100644 --- a/src/plugins/data/server/plugin.ts +++ b/src/plugins/data/server/plugin.ts @@ -10,7 +10,7 @@ import { CoreSetup, CoreStart, Logger, Plugin, PluginInitializerContext } from ' import { ExpressionsServerSetup } from 'src/plugins/expressions/server'; import { BfetchServerSetup } from 'src/plugins/bfetch/server'; import { ConfigSchema } from '../config'; -import { IndexPatternsServiceProvider, IndexPatternsServiceStart } from './index_patterns'; +import { IndexPatternsServiceProvider, IndexPatternsServiceStart } from './data_views'; import { ISearchSetup, ISearchStart, SearchEnhancements } from './search'; import { SearchService } from './search/search_service'; import { QueryService } from './query/query_service'; diff --git a/src/plugins/data/server/search/aggs/aggs_service.test.ts b/src/plugins/data/server/search/aggs/aggs_service.test.ts index fdff2a4a8118c..d03ee17bdaeb9 100644 --- a/src/plugins/data/server/search/aggs/aggs_service.test.ts +++ b/src/plugins/data/server/search/aggs/aggs_service.test.ts @@ -12,7 +12,7 @@ import { coreMock } from '../../../../../core/server/mocks'; import { expressionsPluginMock } from '../../../../../plugins/expressions/server/mocks'; import { BucketAggType, getAggTypes, MetricAggType } from '../../../common'; import { createFieldFormatsStartMock } from '../../../../field_formats/server/mocks'; -import { createIndexPatternsStartMock } from '../../index_patterns/mocks'; +import { createIndexPatternsStartMock } from '../../data_views/mocks'; import { AggsService, AggsSetupDependencies, AggsStartDependencies } from './aggs_service'; diff --git a/src/plugins/data/server/search/aggs/aggs_service.ts b/src/plugins/data/server/search/aggs/aggs_service.ts index 197d8fd7caa99..ed18ef7e4f350 100644 --- a/src/plugins/data/server/search/aggs/aggs_service.ts +++ b/src/plugins/data/server/search/aggs/aggs_service.ts @@ -23,7 +23,7 @@ import { TimeRange, } from '../../../common'; import { FieldFormatsStart } from '../../../../field_formats/server'; -import { IndexPatternsServiceStart } from '../../index_patterns'; +import { IndexPatternsServiceStart } from '../../data_views'; import { AggsSetup, AggsStart } from './types'; /** @internal */ diff --git a/src/plugins/data/server/search/expressions/esaggs.test.ts b/src/plugins/data/server/search/expressions/esaggs.test.ts index 37c5f90f00f4d..5833846cf96e3 100644 --- a/src/plugins/data/server/search/expressions/esaggs.test.ts +++ b/src/plugins/data/server/search/expressions/esaggs.test.ts @@ -11,7 +11,7 @@ import { of as mockOf } from 'rxjs'; import type { MockedKeys } from '@kbn/utility-types/jest'; import { KibanaRequest } from 'src/core/server'; import type { ExecutionContext } from 'src/plugins/expressions/server'; -import type { IndexPatternsContract } from '../../../common/index_patterns/index_patterns'; +import type { IndexPatternsContract } from '../../../common'; import type { AggsCommonStart, ISearchStartSearchSource, diff --git a/src/plugins/data/server/search/expressions/kibana_context.ts b/src/plugins/data/server/search/expressions/kibana_context.ts index c8fdbf4764b0e..191a0fdb7ae88 100644 --- a/src/plugins/data/server/search/expressions/kibana_context.ts +++ b/src/plugins/data/server/search/expressions/kibana_context.ts @@ -9,7 +9,7 @@ import { StartServicesAccessor } from 'src/core/server'; import { getKibanaContextFn } from '../../../common/search/expressions'; import { DataPluginStart, DataPluginStartDependencies } from '../../plugin'; -import { SavedObjectsClientCommon } from '../../../common/index_patterns'; +import { SavedObjectsClientCommon } from '../../../common'; /** * This is some glue code that takes in `core.getStartServices`, extracts the dependencies diff --git a/src/plugins/data/server/search/search_service.test.ts b/src/plugins/data/server/search/search_service.test.ts index e6db3c76ef9ba..e3738fd3a9304 100644 --- a/src/plugins/data/server/search/search_service.test.ts +++ b/src/plugins/data/server/search/search_service.test.ts @@ -12,7 +12,7 @@ import { coreMock } from '../../../../core/server/mocks'; import { DataPluginStart, DataPluginStartDependencies } from '../plugin'; import { createFieldFormatsStartMock } from '../../../field_formats/server/mocks'; -import { createIndexPatternsStartMock } from '../index_patterns/mocks'; +import { createIndexPatternsStartMock } from '../data_views/mocks'; import { SearchService, SearchServiceSetupDependencies } from './search_service'; import { bfetchPluginMock } from '../../../bfetch/server/mocks'; diff --git a/src/plugins/data/server/search/search_service.ts b/src/plugins/data/server/search/search_service.ts index 5b4ff121f3c77..a0378414ed9bb 100644 --- a/src/plugins/data/server/search/search_service.ts +++ b/src/plugins/data/server/search/search_service.ts @@ -35,8 +35,8 @@ import type { import { AggsService } from './aggs'; import { FieldFormatsStart } from '../../../field_formats/server'; -import { IndexPatternsServiceStart } from '../index_patterns'; import { registerMsearchRoute, registerSearchRoute } from './routes'; +import { IndexPatternsServiceStart } from '../data_views'; import { ES_SEARCH_STRATEGY, esSearchStrategyProvider } from './strategies/es_search'; import { DataPluginStart, DataPluginStartDependencies } from '../plugin'; import { UsageCollectionSetup } from '../../../usage_collection/server'; diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts index 5874be19b0b74..c15c02264759c 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts @@ -8,7 +8,7 @@ import ReactDOM from 'react-dom/server'; import { formatRow, formatTopLevelObject } from './row_formatter'; -import { IndexPattern } from '../../../../../../../../data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../../../../../../data/common'; import { fieldFormatsMock } from '../../../../../../../../field_formats/common/mocks'; import { setServices } from '../../../../../../kibana_services'; import { DiscoverServices } from '../../../../../../build_services'; diff --git a/src/plugins/home/public/application/components/home_app.js b/src/plugins/home/public/application/components/home_app.js index ef70dac20d3cc..9e2d3f77b015b 100644 --- a/src/plugins/home/public/application/components/home_app.js +++ b/src/plugins/home/public/application/components/home_app.js @@ -75,7 +75,7 @@ export function HomeApp({ directories, solutions }) { localStorage={localStorage} urlBasePath={getBasePath()} telemetry={telemetry} - hasUserIndexPattern={() => indexPatternService.hasUserIndexPattern()} + hasUserIndexPattern={() => indexPatternService.hasUserDataView()} /> diff --git a/src/plugins/home/server/services/new_instance_status.ts b/src/plugins/home/server/services/new_instance_status.ts index 00223589a8d41..b72ada27ecbad 100644 --- a/src/plugins/home/server/services/new_instance_status.ts +++ b/src/plugins/home/server/services/new_instance_status.ts @@ -7,7 +7,7 @@ */ import type { IScopedClusterClient, SavedObjectsClientContract } from '../../../../core/server'; -import type { IndexPatternSavedObjectAttrs } from '../../../data/common/index_patterns/index_patterns'; +import type { IndexPatternSavedObjectAttrs } from '../../../data/common/data_views/data_views'; const LOGS_INDEX_PATTERN = 'logs-*'; const METRICS_INDEX_PATTERN = 'metrics-*'; diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx b/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx index 246466680c86e..591d3975acae7 100644 --- a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx +++ b/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx @@ -56,7 +56,7 @@ export const EmptyPrompts: FC = ({ allSources, onCancel, children, loadSo const hasDataIndices = allSources.some(isUserDataIndex); const hasUserIndexPattern = useAsync(() => - indexPatternService.hasUserIndexPattern().catch(() => true) + indexPatternService.hasUserDataView().catch(() => true) ); useEffect(() => { diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx index e6aa87172ca0b..75da4dce74368 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { ScriptedFieldsTable } from '../scripted_fields_table'; -import { IIndexPattern, IndexPattern } from '../../../../../../plugins/data/common/index_patterns'; +import { IIndexPattern, IndexPattern } from '../../../../../../plugins/data/common'; jest.mock('@elastic/eui', () => ({ EuiTitle: 'eui-title', diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx b/src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx index c8617808b10ec..f82d30aff8086 100644 --- a/src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx +++ b/src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx @@ -83,7 +83,7 @@ export const IndexPatternTable = ({ setIsLoadingIndexPatterns(false); if ( gettedIndexPatterns.length === 0 || - !(await data.dataViews.hasUserIndexPattern().catch(() => false)) + !(await data.dataViews.hasUserDataView().catch(() => false)) ) { setShowCreateDialog(true); } diff --git a/src/plugins/kibana_overview/public/components/overview/overview.tsx b/src/plugins/kibana_overview/public/components/overview/overview.tsx index b49be0670b582..07769e2f3c474 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.tsx @@ -100,7 +100,7 @@ export const Overview: FC = ({ newsFetchResult, solutions, features }) => useEffect(() => { const fetchIsNewKibanaInstance = async () => { - const hasUserIndexPattern = await indexPatternService.hasUserIndexPattern().catch(() => true); + const hasUserIndexPattern = await indexPatternService.hasUserDataView().catch(() => true); setNewKibanaInstance(!hasUserIndexPattern); }; diff --git a/src/plugins/saved_objects/public/saved_object/saved_object.test.ts b/src/plugins/saved_objects/public/saved_object/saved_object.test.ts index 842e7ad962572..6d35f94eec510 100644 --- a/src/plugins/saved_objects/public/saved_object/saved_object.test.ts +++ b/src/plugins/saved_objects/public/saved_object/saved_object.test.ts @@ -20,7 +20,7 @@ import { coreMock } from '../../../../core/public/mocks'; import { dataPluginMock, createSearchSourceMock } from '../../../../plugins/data/public/mocks'; import { createStubIndexPattern } from '../../../../plugins/data/common/stubs'; import { SavedObjectAttributes, SimpleSavedObject } from 'kibana/public'; -import { IndexPattern } from '../../../data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../data/common'; import { savedObjectsDecoratorRegistryMock } from './decorators/registry.mock'; describe('Saved Object', () => { diff --git a/test/api_integration/apis/index_patterns/es_errors/errors.js b/test/api_integration/apis/index_patterns/es_errors/errors.js index 1a48b391ae87d..ac656e487323d 100644 --- a/test/api_integration/apis/index_patterns/es_errors/errors.js +++ b/test/api_integration/apis/index_patterns/es_errors/errors.js @@ -15,7 +15,7 @@ import { createNoMatchingIndicesError, isNoMatchingIndicesError, convertEsError, -} from '../../../../../src/plugins/data/server/index_patterns/fetcher/lib/errors'; +} from '../../../../../src/plugins/data/server/data_views/fetcher/lib/errors'; import { getIndexNotFoundError, getDocNotFoundError } from './lib';