From 2882edab09754e03dca87ee6041747efcff4184a Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Mon, 30 Mar 2020 12:03:55 -0600 Subject: [PATCH 01/14] Move layers to new location --- .../plugins/maps/public/layers/_index.scss | 1 - .../maps/public/layers/styles/_index.scss | 4 ---- x-pack/plugins/maps/public/layers/_index.scss | 1 + .../maps/public/layers/blended_vector_layer.ts | 6 +++--- .../public/layers/fields/ems_file_field.ts | 2 +- .../public/layers/fields/es_agg_field.test.ts | 2 +- .../maps/public/layers/fields/es_agg_field.ts | 4 ++-- .../maps/public/layers/fields/es_doc_field.ts | 8 ++++---- .../plugins/maps/public/layers/fields/field.ts | 2 +- .../layers/fields/kibana_region_field.ts | 2 +- .../layers/fields/top_term_percentage_field.ts | 4 ++-- .../maps/public/layers/heatmap_layer.js | 5 ++++- .../maps/public/layers/joins/inner_join.js | 5 ++++- .../public/layers/joins/inner_join.test.js | 0 .../plugins/maps/public/layers/joins/join.ts | 0 .../plugins/maps/public/layers/layer.d.ts | 4 ++-- .../plugins/maps/public/layers/layer.js | 4 ++-- .../maps/public/layers/sources/all_sources.js | 0 .../create_client_file_source_editor.js | 2 +- .../client_file_source/geojson_file_source.js | 2 +- .../layers/sources/client_file_source/index.js | 0 .../ems_file_source/create_source_editor.js | 2 +- .../ems_file_source/ems_file_source.d.ts | 0 .../sources/ems_file_source/ems_file_source.js | 6 +++--- .../ems_file_source/ems_file_source.test.js | 0 .../layers/sources/ems_file_source/index.js | 0 .../ems_file_source/update_source_editor.js | 4 ++-- .../sources/ems_tms_source/ems_tms_source.js | 11 +++++++---- .../ems_tms_source/ems_tms_source.test.js | 0 .../layers/sources/ems_tms_source/index.js | 0 .../ems_tms_source/tile_service_select.js | 2 +- .../ems_tms_source/update_source_editor.js | 0 .../layers/sources/ems_unavailable_message.js | 2 +- .../public/layers/sources/es_agg_source.d.ts | 4 ++-- .../public/layers/sources/es_agg_source.js | 2 +- .../layers/sources/es_agg_source.test.ts | 4 ++-- .../es_geo_grid_source/convert_to_geojson.js | 4 ++-- .../convert_to_geojson.test.ts | 2 +- .../es_geo_grid_source/create_source_editor.js | 13 ++++++++----- .../es_geo_grid_source/es_geo_grid_source.d.ts | 4 ++-- .../es_geo_grid_source/es_geo_grid_source.js | 4 ++-- .../es_geo_grid_source.test.ts | 6 +++++- .../es_geo_grid_source/geo_tile_utils.js | 4 ++-- .../es_geo_grid_source/geo_tile_utils.test.js | 0 .../layers/sources/es_geo_grid_source/index.js | 0 .../es_geo_grid_source/resolution_editor.js | 2 +- .../es_geo_grid_source/update_source_editor.js | 8 ++++---- .../es_pew_pew_source/convert_to_lines.js | 0 .../es_pew_pew_source/convert_to_lines.test.ts | 0 .../es_pew_pew_source/create_source_editor.js | 9 ++++++--- .../es_pew_pew_source/es_pew_pew_source.js | 6 +++--- .../es_pew_pew_source/update_source_editor.js | 6 +++--- .../__snapshots__/scaling_form.test.tsx.snap | 0 .../update_source_editor.test.js.snap | 0 .../sources/es_search_source/constants.js | 0 .../es_search_source/create_source_editor.js | 18 ++++++++++++------ .../es_search_source/es_search_source.d.ts | 2 +- .../es_search_source/es_search_source.js | 10 +++++----- .../es_search_source/es_search_source.test.ts | 6 +++--- .../layers/sources/es_search_source/index.js | 0 .../es_search_source/load_index_settings.js | 4 ++-- .../es_search_source/scaling_form.test.tsx | 2 +- .../sources/es_search_source/scaling_form.tsx | 17 ++++++++++------- .../es_search_source/update_source_editor.js | 15 +++++++++------ .../update_source_editor.test.js | 2 +- .../maps/public/layers/sources/es_source.d.ts | 4 ++-- .../maps/public/layers/sources/es_source.js | 8 ++++---- .../public/layers/sources/es_term_source.d.ts | 0 .../public/layers/sources/es_term_source.js | 6 +++++- .../layers/sources/es_term_source.test.js | 0 .../create_source_editor.js | 2 +- .../sources/kibana_regionmap_source/index.js | 0 .../kibana_regionmap_source.d.ts | 0 .../kibana_regionmap_source.js | 6 +++--- .../create_source_editor.js | 2 +- .../sources/kibana_tilemap_source/index.js | 0 .../kibana_tilemap_source.js | 4 ++-- .../maps/public/layers/sources/source.d.ts | 2 +- .../maps/public/layers/sources/source.js | 2 +- .../maps/public/layers/sources/tms_source.d.ts | 0 .../maps/public/layers/sources/tms_source.js | 0 .../layers/sources/vector_feature_types.js | 0 .../public/layers/sources/vector_source.d.ts | 2 +- .../public/layers/sources/vector_source.js | 0 .../public/layers/sources/wms_source/index.js | 0 .../layers/sources/wms_source/wms_client.js | 2 +- .../sources/wms_source/wms_client.test.js | 0 .../wms_source/wms_create_source_editor.js | 0 .../layers/sources/wms_source/wms_source.js | 5 ++++- .../public/layers/sources/xyz_tms_source.d.ts | 2 +- .../public/layers/sources/xyz_tms_source.js | 7 +++++-- .../layers/sources/xyz_tms_source.test.ts | 4 ++-- .../maps/public/layers/styles/_index.scss | 4 ++++ .../public/layers/styles/abstract_style.js | 0 .../maps/public/layers/styles/color_utils.js | 4 ++-- .../public/layers/styles/color_utils.test.js | 0 .../styles/components/_color_gradient.scss | 0 .../layers/styles/components/color_gradient.js | 0 .../components/ranged_style_legend_row.js | 0 .../heatmap_style_editor.test.js.snap | 0 .../heatmap/components/heatmap_constants.js | 0 .../heatmap/components/heatmap_style_editor.js | 0 .../components/heatmap_style_editor.test.js | 0 .../components/legend/heatmap_legend.js | 0 .../layers/styles/heatmap/heatmap_style.js | 5 ++++- .../vector/components/_style_prop_editor.scss | 0 .../vector/components/color/_color_stops.scss | 0 .../components/color/color_map_select.js | 2 +- .../vector/components/color/color_stops.js | 0 .../color/color_stops_categorical.js | 0 .../components/color/color_stops_ordinal.js | 0 .../components/color/color_stops_utils.js | 0 .../components/color/dynamic_color_form.js | 5 ++++- .../components/color/static_color_form.js | 0 .../color/vector_style_color_editor.js | 0 .../categorical_field_meta_popover.tsx | 2 +- .../field_meta/field_meta_popover.tsx | 0 .../field_meta/ordinal_field_meta_popover.tsx | 4 ++-- .../styles/vector/components/field_select.js | 4 ++-- .../components/get_vector_style_label.js | 2 +- .../components/label/dynamic_label_form.js | 0 .../components/label/static_label_form.js | 0 .../vector_style_label_border_size_editor.js | 5 ++++- .../label/vector_style_label_editor.js | 0 .../__snapshots__/vector_icon.test.js.snap | 0 .../vector/components/legend/category.js | 2 +- .../vector/components/legend/circle_icon.js | 0 .../extract_color_from_style_property.js | 5 ++++- .../vector/components/legend/line_icon.js | 0 .../vector/components/legend/polygon_icon.js | 0 .../vector/components/legend/symbol_icon.js | 0 .../vector/components/legend/vector_icon.js | 0 .../components/legend/vector_icon.test.js | 0 .../components/legend/vector_style_legend.js | 0 .../orientation/dynamic_orientation_form.js | 0 .../orientation/orientation_editor.js | 0 .../orientation/static_orientation_form.js | 2 +- .../components/size/dynamic_size_form.js | 0 .../components/size/size_range_selector.js | 2 +- .../vector/components/size/static_size_form.js | 2 +- .../size/vector_style_size_editor.js | 0 .../styles/vector/components/stop_input.js | 0 .../vector/components/style_map_select.js | 0 .../vector/components/style_option_shapes.js | 0 .../vector/components/style_prop_editor.js | 2 +- .../__snapshots__/icon_select.test.js.snap | 0 .../vector/components/symbol/_icon_select.scss | 0 .../components/symbol/dynamic_icon_form.js | 0 .../components/symbol/icon_map_select.js | 0 .../vector/components/symbol/icon_select.js | 0 .../components/symbol/icon_select.test.js | 0 .../vector/components/symbol/icon_stops.js | 2 +- .../components/symbol/icon_stops.test.js | 0 .../components/symbol/static_icon_form.js | 0 .../symbol/vector_style_icon_editor.js | 2 +- .../symbol/vector_style_symbolize_as_editor.js | 5 ++++- .../vector/components/vector_style_editor.js | 2 +- .../dynamic_color_property.test.js.snap | 0 .../components/categorical_legend.js | 0 .../properties/components/ordinal_legend.js | 0 .../properties/dynamic_color_property.js | 2 +- .../properties/dynamic_color_property.test.js | 6 +++++- .../vector/properties/dynamic_icon_property.js | 0 .../properties/dynamic_orientation_property.js | 2 +- .../vector/properties/dynamic_size_property.js | 2 +- .../properties/dynamic_style_property.d.ts | 4 ++-- .../properties/dynamic_style_property.js | 2 +- .../vector/properties/dynamic_text_property.js | 0 .../properties/label_border_size_property.js | 2 +- .../vector/properties/static_color_property.js | 0 .../vector/properties/static_icon_property.js | 0 .../properties/static_orientation_property.js | 0 .../vector/properties/static_size_property.js | 0 .../vector/properties/static_style_property.js | 2 +- .../vector/properties/static_text_property.js | 0 .../styles/vector/properties/style_property.ts | 7 +++++-- .../vector/properties/symbolize_as_property.js | 2 +- .../public/layers/styles/vector/style_meta.ts | 2 +- .../public/layers/styles/vector/style_util.js | 0 .../layers/styles/vector/style_util.test.js | 0 .../layers/styles/vector/symbol_utils.js | 2 +- .../layers/styles/vector/symbol_utils.test.js | 0 .../layers/styles/vector/vector_style.d.ts | 2 +- .../layers/styles/vector/vector_style.js | 2 +- .../layers/styles/vector/vector_style.test.js | 4 ++-- .../styles/vector/vector_style_defaults.ts | 6 +++--- .../plugins/maps/public/layers/tile_layer.d.ts | 2 +- .../plugins/maps/public/layers/tile_layer.js | 5 ++++- .../maps/public/layers/tile_layer.test.ts | 4 ++-- .../layers/tooltips/es_agg_tooltip_property.ts | 0 .../layers/tooltips/es_tooltip_property.ts | 4 ++-- .../layers/tooltips/join_tooltip_property.ts | 2 +- .../public/layers/tooltips/tooltip_property.ts | 2 +- .../layers/util/assign_feature_ids.test.ts | 2 +- .../public/layers/util/assign_feature_ids.ts | 2 +- .../public/layers/util/can_skip_fetch.test.js | 0 .../maps/public/layers/util/can_skip_fetch.ts | 2 +- .../maps/public/layers/util/data_request.ts | 5 ++++- .../public/layers/util/es_agg_utils.test.ts | 0 .../maps/public/layers/util/es_agg_utils.ts | 4 ++-- .../public/layers/util/is_metric_countable.ts | 2 +- .../layers/util/is_refresh_only_query.ts | 2 +- .../layers/util/mb_filter_expressions.ts | 5 ++++- .../maps/public/layers/vector_layer.d.ts | 4 ++-- .../plugins/maps/public/layers/vector_layer.js | 2 +- .../maps/public/layers/vector_tile_layer.js | 9 ++++++--- 206 files changed, 271 insertions(+), 196 deletions(-) delete mode 100644 x-pack/legacy/plugins/maps/public/layers/_index.scss delete mode 100644 x-pack/legacy/plugins/maps/public/layers/styles/_index.scss create mode 100644 x-pack/plugins/maps/public/layers/_index.scss rename x-pack/{legacy => }/plugins/maps/public/layers/blended_vector_layer.ts (97%) rename x-pack/{legacy => }/plugins/maps/public/layers/fields/ems_file_field.ts (93%) rename x-pack/{legacy => }/plugins/maps/public/layers/fields/es_agg_field.test.ts (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/fields/es_agg_field.ts (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/fields/es_doc_field.ts (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/fields/field.ts (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/fields/kibana_region_field.ts (93%) rename x-pack/{legacy => }/plugins/maps/public/layers/fields/top_term_percentage_field.ts (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/heatmap_layer.js (97%) rename x-pack/{legacy => }/plugins/maps/public/layers/joins/inner_join.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/joins/inner_join.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/joins/join.ts (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/layer.d.ts (86%) rename x-pack/{legacy => }/plugins/maps/public/layers/layer.js (98%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/all_sources.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js (88%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js (98%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/client_file_source/index.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.d.ts (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js (94%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_file_source/index.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js (92%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js (92%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_tms_source/index.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_tms_source/update_source_editor.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/ems_unavailable_message.js (89%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_agg_source.d.ts (83%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_agg_source.js (98%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_agg_source.test.ts (93%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js (92%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts (98%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts (79%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js (98%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts (90%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js (94%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/index.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js (93%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js (89%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.test.ts (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js (94%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js (87%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/__snapshots__/scaling_form.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/constants.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts (80%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/es_search_source.js (97%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts (74%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/index.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx (93%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx (89%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js (93%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_source.d.ts (85%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_source.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_term_source.d.ts (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_term_source.js (97%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/es_term_source.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js (94%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/kibana_regionmap_source/index.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.d.ts (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js (92%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js (93%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/kibana_tilemap_source/index.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js (93%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/source.d.ts (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/source.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/tms_source.d.ts (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/tms_source.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/vector_feature_types.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/vector_source.d.ts (92%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/vector_source.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/wms_source/index.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/wms_source/wms_client.js (98%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/wms_source/wms_client.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/wms_source/wms_create_source_editor.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/wms_source/wms_source.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/xyz_tms_source.d.ts (81%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/xyz_tms_source.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/sources/xyz_tms_source.test.ts (84%) create mode 100644 x-pack/plugins/maps/public/layers/styles/_index.scss rename x-pack/{legacy => }/plugins/maps/public/layers/styles/abstract_style.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/color_utils.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/color_utils.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/components/_color_gradient.scss (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/components/color_gradient.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/components/ranged_style_legend_row.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.js.snap (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/heatmap/components/heatmap_constants.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/heatmap/components/heatmap_style_editor.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/heatmap/components/heatmap_style_editor.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/heatmap/components/legend/heatmap_legend.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/heatmap/heatmap_style.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/_style_prop_editor.scss (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/color/_color_stops.scss (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js (98%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/color/color_stops.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/color/color_stops_categorical.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/color/color_stops_ordinal.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/color/color_stops_utils.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js (97%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/color/static_color_form.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/color/vector_style_color_editor.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx (93%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/field_meta/field_meta_popover.tsx (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx (94%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/field_select.js (95%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/label/dynamic_label_form.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/label/static_label_form.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js (94%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_editor.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/legend/__snapshots__/vector_icon.test.js.snap (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/legend/category.js (92%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/legend/circle_icon.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js (94%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/legend/line_icon.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/legend/polygon_icon.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/legend/symbol_icon.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/legend/vector_icon.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/legend/vector_icon.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/legend/vector_style_legend.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/orientation/dynamic_orientation_form.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/orientation/orientation_editor.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js (90%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/size/dynamic_size_form.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/size/size_range_selector.js (92%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/size/vector_style_size_editor.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/stop_input.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/style_map_select.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/style_option_shapes.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js (97%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/__snapshots__/icon_select.test.js.snap (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/_icon_select.scss (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/dynamic_icon_form.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/icon_map_select.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/icon_select.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/icon_select.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js (98%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/static_icon_form.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js (90%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js (94%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js (99%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/__snapshots__/dynamic_color_property.test.js.snap (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/components/categorical_legend.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/components/ordinal_legend.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js (99%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js (99%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/dynamic_icon_property.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js (98%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts (89%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js (99%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/dynamic_text_property.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js (95%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/static_color_property.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/static_icon_property.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/static_orientation_property.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/static_size_property.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/static_style_property.js (82%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/static_text_property.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/style_property.ts (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js (84%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/style_meta.ts (95%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/style_util.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/style_util.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/symbol_utils.js (97%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/symbol_utils.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/vector_style.d.ts (90%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/vector_style.js (99%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/vector_style.test.js (97%) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts (95%) rename x-pack/{legacy => }/plugins/maps/public/layers/tile_layer.d.ts (86%) rename x-pack/{legacy => }/plugins/maps/public/layers/tile_layer.js (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/tile_layer.test.ts (90%) rename x-pack/{legacy => }/plugins/maps/public/layers/tooltips/es_agg_tooltip_property.ts (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/tooltips/es_tooltip_property.ts (95%) rename x-pack/{legacy => }/plugins/maps/public/layers/tooltips/join_tooltip_property.ts (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/tooltips/tooltip_property.ts (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/util/assign_feature_ids.test.ts (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/util/assign_feature_ids.ts (96%) rename x-pack/{legacy => }/plugins/maps/public/layers/util/can_skip_fetch.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/util/can_skip_fetch.ts (98%) rename x-pack/{legacy => }/plugins/maps/public/layers/util/data_request.ts (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/util/es_agg_utils.test.ts (100%) rename x-pack/{legacy => }/plugins/maps/public/layers/util/es_agg_utils.ts (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/util/is_metric_countable.ts (83%) rename x-pack/{legacy => }/plugins/maps/public/layers/util/is_refresh_only_query.ts (89%) rename x-pack/{legacy => }/plugins/maps/public/layers/util/mb_filter_expressions.ts (93%) rename x-pack/{legacy => }/plugins/maps/public/layers/vector_layer.d.ts (91%) rename x-pack/{legacy => }/plugins/maps/public/layers/vector_layer.js (99%) rename x-pack/{legacy => }/plugins/maps/public/layers/vector_tile_layer.js (96%) diff --git a/x-pack/legacy/plugins/maps/public/layers/_index.scss b/x-pack/legacy/plugins/maps/public/layers/_index.scss deleted file mode 100644 index a2ce58e0381af..0000000000000 --- a/x-pack/legacy/plugins/maps/public/layers/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './styles/index'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/_index.scss b/x-pack/legacy/plugins/maps/public/layers/styles/_index.scss deleted file mode 100644 index b5d9113619c76..0000000000000 --- a/x-pack/legacy/plugins/maps/public/layers/styles/_index.scss +++ /dev/null @@ -1,4 +0,0 @@ -@import './components/color_gradient'; -@import './vector/components/style_prop_editor'; -@import './vector/components/color/color_stops'; -@import './vector/components/symbol/icon_select'; diff --git a/x-pack/plugins/maps/public/layers/_index.scss b/x-pack/plugins/maps/public/layers/_index.scss new file mode 100644 index 0000000000000..29a5761255278 --- /dev/null +++ b/x-pack/plugins/maps/public/layers/_index.scss @@ -0,0 +1 @@ +@import 'styles/index'; diff --git a/x-pack/legacy/plugins/maps/public/layers/blended_vector_layer.ts b/x-pack/plugins/maps/public/layers/blended_vector_layer.ts similarity index 97% rename from x-pack/legacy/plugins/maps/public/layers/blended_vector_layer.ts rename to x-pack/plugins/maps/public/layers/blended_vector_layer.ts index f5526ad703dd2..a86ce684a621b 100644 --- a/x-pack/legacy/plugins/maps/public/layers/blended_vector_layer.ts +++ b/x-pack/plugins/maps/public/layers/blended_vector_layer.ts @@ -21,20 +21,20 @@ import { VECTOR_STYLES, LAYER_STYLE_TYPE, FIELD_ORIGIN, -} from '../../common/constants'; +} from '../../../../legacy/plugins/maps/common/constants'; import { ESGeoGridSource } from './sources/es_geo_grid_source/es_geo_grid_source'; import { canSkipSourceUpdate } from './util/can_skip_fetch'; import { IVectorLayer, VectorLayerArguments } from './vector_layer'; import { IESSource } from './sources/es_source'; import { IESAggSource } from './sources/es_agg_source'; import { ISource } from './sources/source'; -import { SyncContext } from '../actions/map_actions'; +import { SyncContext } from '../../../../legacy/plugins/maps/public/actions/map_actions'; import { DataRequestAbortError } from './util/data_request'; import { VectorStyleDescriptor, SizeDynamicOptions, DynamicStylePropertyOptions, -} from '../../common/descriptor_types'; +} from '../../../../legacy/plugins/maps/common/descriptor_types'; const ACTIVE_COUNT_DATA_ID = 'ACTIVE_COUNT_DATA_ID'; diff --git a/x-pack/legacy/plugins/maps/public/layers/fields/ems_file_field.ts b/x-pack/plugins/maps/public/layers/fields/ems_file_field.ts similarity index 93% rename from x-pack/legacy/plugins/maps/public/layers/fields/ems_file_field.ts rename to x-pack/plugins/maps/public/layers/fields/ems_file_field.ts index c14886bc37bfb..a4056df68879f 100644 --- a/x-pack/legacy/plugins/maps/public/layers/fields/ems_file_field.ts +++ b/x-pack/plugins/maps/public/layers/fields/ems_file_field.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FIELD_ORIGIN } from '../../../common/constants'; +import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; import { IField, AbstractField } from './field'; import { IVectorSource } from '../sources/vector_source'; import { IEmsFileSource } from '../sources/ems_file_source/ems_file_source'; diff --git a/x-pack/legacy/plugins/maps/public/layers/fields/es_agg_field.test.ts b/x-pack/plugins/maps/public/layers/fields/es_agg_field.test.ts similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/fields/es_agg_field.test.ts rename to x-pack/plugins/maps/public/layers/fields/es_agg_field.test.ts index 7a65b5f9f6b46..5c31804ebdadb 100644 --- a/x-pack/legacy/plugins/maps/public/layers/fields/es_agg_field.test.ts +++ b/x-pack/plugins/maps/public/layers/fields/es_agg_field.test.ts @@ -5,7 +5,7 @@ */ import { ESAggField, esAggFieldsFactory } from './es_agg_field'; -import { AGG_TYPE, FIELD_ORIGIN } from '../../../common/constants'; +import { AGG_TYPE, FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; import { IESAggSource } from '../sources/es_agg_source'; import { IIndexPattern } from 'src/plugins/data/public'; diff --git a/x-pack/legacy/plugins/maps/public/layers/fields/es_agg_field.ts b/x-pack/plugins/maps/public/layers/fields/es_agg_field.ts similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/fields/es_agg_field.ts rename to x-pack/plugins/maps/public/layers/fields/es_agg_field.ts index 65f952ca01038..daadf48358ddd 100644 --- a/x-pack/legacy/plugins/maps/public/layers/fields/es_agg_field.ts +++ b/x-pack/plugins/maps/public/layers/fields/es_agg_field.ts @@ -6,11 +6,11 @@ import { IndexPattern } from 'src/plugins/data/public'; import { IField } from './field'; -import { AggDescriptor } from '../../../common/descriptor_types'; +import { AggDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; import { IESAggSource } from '../sources/es_agg_source'; import { IVectorSource } from '../sources/vector_source'; import { ESDocField } from './es_doc_field'; -import { AGG_TYPE, FIELD_ORIGIN } from '../../../common/constants'; +import { AGG_TYPE, FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; import { isMetricCountable } from '../util/is_metric_countable'; import { getField, addFieldToDSL } from '../util/es_agg_utils'; import { TopTermPercentageField } from './top_term_percentage_field'; diff --git a/x-pack/legacy/plugins/maps/public/layers/fields/es_doc_field.ts b/x-pack/plugins/maps/public/layers/fields/es_doc_field.ts similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/fields/es_doc_field.ts rename to x-pack/plugins/maps/public/layers/fields/es_doc_field.ts index 4401452841a46..4153ebbcddff1 100644 --- a/x-pack/legacy/plugins/maps/public/layers/fields/es_doc_field.ts +++ b/x-pack/plugins/maps/public/layers/fields/es_doc_field.ts @@ -4,12 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FIELD_ORIGIN } from '../../../common/constants'; +import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; import { ESTooltipProperty } from '../tooltips/es_tooltip_property'; import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property'; -import { COLOR_PALETTE_MAX_SIZE } from '../../../common/constants'; -import { indexPatterns } from '../../../../../../../src/plugins/data/public'; -import { IFieldType } from '../../../../../../../src/plugins/data/public'; +import { COLOR_PALETTE_MAX_SIZE } from '../../../../../legacy/plugins/maps/common/constants'; +import { indexPatterns } from '../../../../../../src/plugins/data/public'; +import { IFieldType } from '../../../../../../src/plugins/data/public'; import { IField, AbstractField } from './field'; import { IESSource } from '../sources/es_source'; import { IVectorSource } from '../sources/vector_source'; diff --git a/x-pack/legacy/plugins/maps/public/layers/fields/field.ts b/x-pack/plugins/maps/public/layers/fields/field.ts similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/fields/field.ts rename to x-pack/plugins/maps/public/layers/fields/field.ts index b431be4aa6cb8..78b17ed624b93 100644 --- a/x-pack/legacy/plugins/maps/public/layers/fields/field.ts +++ b/x-pack/plugins/maps/public/layers/fields/field.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FIELD_ORIGIN } from '../../../common/constants'; +import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; import { IVectorSource } from '../sources/vector_source'; import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property'; diff --git a/x-pack/legacy/plugins/maps/public/layers/fields/kibana_region_field.ts b/x-pack/plugins/maps/public/layers/fields/kibana_region_field.ts similarity index 93% rename from x-pack/legacy/plugins/maps/public/layers/fields/kibana_region_field.ts rename to x-pack/plugins/maps/public/layers/fields/kibana_region_field.ts index 9b619cf60a020..82ecf8f905f24 100644 --- a/x-pack/legacy/plugins/maps/public/layers/fields/kibana_region_field.ts +++ b/x-pack/plugins/maps/public/layers/fields/kibana_region_field.ts @@ -6,7 +6,7 @@ import { IField, AbstractField } from './field'; import { IKibanaRegionSource } from '../sources/kibana_regionmap_source/kibana_regionmap_source'; -import { FIELD_ORIGIN } from '../../../common/constants'; +import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; import { IVectorSource } from '../sources/vector_source'; export class KibanaRegionField extends AbstractField implements IField { diff --git a/x-pack/legacy/plugins/maps/public/layers/fields/top_term_percentage_field.ts b/x-pack/plugins/maps/public/layers/fields/top_term_percentage_field.ts similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/fields/top_term_percentage_field.ts rename to x-pack/plugins/maps/public/layers/fields/top_term_percentage_field.ts index 84bade4d94490..d67b8c32c3581 100644 --- a/x-pack/legacy/plugins/maps/public/layers/fields/top_term_percentage_field.ts +++ b/x-pack/plugins/maps/public/layers/fields/top_term_percentage_field.ts @@ -8,8 +8,8 @@ import { IESAggField } from './es_agg_field'; import { IVectorSource } from '../sources/vector_source'; // @ts-ignore import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property'; -import { TOP_TERM_PERCENTAGE_SUFFIX } from '../../../common/constants'; -import { FIELD_ORIGIN } from '../../../common/constants'; +import { TOP_TERM_PERCENTAGE_SUFFIX } from '../../../../../legacy/plugins/maps/common/constants'; +import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; export class TopTermPercentageField implements IESAggField { private readonly _topTermAggField: IESAggField; diff --git a/x-pack/legacy/plugins/maps/public/layers/heatmap_layer.js b/x-pack/plugins/maps/public/layers/heatmap_layer.js similarity index 97% rename from x-pack/legacy/plugins/maps/public/layers/heatmap_layer.js rename to x-pack/plugins/maps/public/layers/heatmap_layer.js index 22f7a92c17c51..923c712051162 100644 --- a/x-pack/legacy/plugins/maps/public/layers/heatmap_layer.js +++ b/x-pack/plugins/maps/public/layers/heatmap_layer.js @@ -7,7 +7,10 @@ import { AbstractLayer } from './layer'; import { VectorLayer } from './vector_layer'; import { HeatmapStyle } from './styles/heatmap/heatmap_style'; -import { EMPTY_FEATURE_COLLECTION, LAYER_TYPE } from '../../common/constants'; +import { + EMPTY_FEATURE_COLLECTION, + LAYER_TYPE, +} from '../../../../legacy/plugins/maps/common/constants'; const SCALED_PROPERTY_NAME = '__kbn_heatmap_weight__'; //unique name to store scaled value for weighting diff --git a/x-pack/legacy/plugins/maps/public/layers/joins/inner_join.js b/x-pack/plugins/maps/public/layers/joins/inner_join.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/joins/inner_join.js rename to x-pack/plugins/maps/public/layers/joins/inner_join.js index 13a2e05ab8eeb..3985bef6c0113 100644 --- a/x-pack/legacy/plugins/maps/public/layers/joins/inner_join.js +++ b/x-pack/plugins/maps/public/layers/joins/inner_join.js @@ -6,7 +6,10 @@ import { ESTermSource } from '../sources/es_term_source'; import { getComputedFieldNamePrefix } from '../styles/vector/style_util'; -import { META_ID_ORIGIN_SUFFIX, FORMATTERS_ID_ORIGIN_SUFFIX } from '../../../common/constants'; +import { + META_ID_ORIGIN_SUFFIX, + FORMATTERS_ID_ORIGIN_SUFFIX, +} from '../../../../../legacy/plugins/maps/common/constants'; export class InnerJoin { constructor(joinDescriptor, leftSource) { diff --git a/x-pack/legacy/plugins/maps/public/layers/joins/inner_join.test.js b/x-pack/plugins/maps/public/layers/joins/inner_join.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/joins/inner_join.test.js rename to x-pack/plugins/maps/public/layers/joins/inner_join.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/joins/join.ts b/x-pack/plugins/maps/public/layers/joins/join.ts similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/joins/join.ts rename to x-pack/plugins/maps/public/layers/joins/join.ts diff --git a/x-pack/legacy/plugins/maps/public/layers/layer.d.ts b/x-pack/plugins/maps/public/layers/layer.d.ts similarity index 86% rename from x-pack/legacy/plugins/maps/public/layers/layer.d.ts rename to x-pack/plugins/maps/public/layers/layer.d.ts index 777566298e607..58b539787eb89 100644 --- a/x-pack/legacy/plugins/maps/public/layers/layer.d.ts +++ b/x-pack/plugins/maps/public/layers/layer.d.ts @@ -3,10 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { LayerDescriptor } from '../../common/descriptor_types'; +import { LayerDescriptor } from '../../../../legacy/plugins/maps/common/descriptor_types'; import { ISource } from './sources/source'; import { DataRequest } from './util/data_request'; -import { SyncContext } from '../actions/map_actions'; +import { SyncContext } from '../../../../legacy/plugins/maps/public/actions/map_actions'; export interface ILayer { getDataRequest(id: string): DataRequest | undefined; diff --git a/x-pack/legacy/plugins/maps/public/layers/layer.js b/x-pack/plugins/maps/public/layers/layer.js similarity index 98% rename from x-pack/legacy/plugins/maps/public/layers/layer.js rename to x-pack/plugins/maps/public/layers/layer.js index d162e342dfd1a..d636f2db01025 100644 --- a/x-pack/legacy/plugins/maps/public/layers/layer.js +++ b/x-pack/plugins/maps/public/layers/layer.js @@ -12,10 +12,10 @@ import { MB_SOURCE_ID_LAYER_ID_PREFIX_DELIMITER, MIN_ZOOM, SOURCE_DATA_ID_ORIGIN, -} from '../../common/constants'; +} from '../../../../legacy/plugins/maps/common/constants'; import uuid from 'uuid/v4'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { copyPersistentState } from '../../../../../plugins/maps/public/reducers/util.js'; +import { copyPersistentState } from '../reducers/util.js'; import { i18n } from '@kbn/i18n'; export class AbstractLayer { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/all_sources.js b/x-pack/plugins/maps/public/layers/sources/all_sources.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/all_sources.js rename to x-pack/plugins/maps/public/layers/sources/all_sources.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js b/x-pack/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js similarity index 88% rename from x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js index f9bfc4ddde91b..fdd33843bae56 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { getFileUploadComponent } from '../../../kibana_services'; +import { getFileUploadComponent } from '../../../../../../legacy/plugins/maps/public/kibana_services'; export function ClientFileCreateSourceEditor({ previewGeojsonFile, diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js b/x-pack/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js similarity index 98% rename from x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js rename to x-pack/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js index a38669fcd1d1a..89bc6e896a476 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js +++ b/x-pack/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js @@ -10,7 +10,7 @@ import { ES_GEO_FIELD_TYPE, GEOJSON_FILE, DEFAULT_MAX_RESULT_WINDOW, -} from '../../../../common/constants'; +} from '../../../../../../legacy/plugins/maps/common/constants'; import { ClientFileCreateSourceEditor } from './create_client_file_source_editor'; import { ESSearchSource } from '../es_search_source'; import uuid from 'uuid/v4'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/index.js b/x-pack/plugins/maps/public/layers/sources/client_file_source/index.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/index.js rename to x-pack/plugins/maps/public/layers/sources/client_file_source/index.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js index 47a4879acb58c..9ccc9f01df761 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiComboBox, EuiFormRow } from '@elastic/eui'; -import { getEMSClient } from '../../../meta'; +import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta'; import { getEmsUnavailableMessage } from '../ems_unavailable_message'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.d.ts b/x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.d.ts similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.d.ts rename to x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.d.ts diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js b/x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js similarity index 94% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js rename to x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js index 524f030862768..b3d5dece05bd5 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js @@ -7,11 +7,11 @@ import { AbstractVectorSource } from '../vector_source'; import { VECTOR_SHAPE_TYPES } from '../vector_feature_types'; import React from 'react'; -import { EMS_FILE, FIELD_ORIGIN } from '../../../../common/constants'; -import { getEMSClient } from '../../../meta'; +import { EMS_FILE, FIELD_ORIGIN } from '../../../../../../legacy/plugins/maps/common/constants'; +import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta'; import { EMSFileCreateSourceEditor } from './create_source_editor'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../common/i18n_getters'; +import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; import { UpdateSourceEditor } from './update_source_editor'; import { EMSFileField } from '../../fields/ems_file_field'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.test.js b/x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.test.js rename to x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/index.js b/x-pack/plugins/maps/public/layers/sources/ems_file_source/index.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/index.js rename to x-pack/plugins/maps/public/layers/sources/ems_file_source/index.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js b/x-pack/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js similarity index 92% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js index b7687fec43272..22ce345ef6cb0 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js @@ -6,8 +6,8 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { TooltipSelector } from '../../../components/tooltip_selector'; -import { getEMSClient } from '../../../meta'; +import { TooltipSelector } from '../../../../../../legacy/plugins/maps/public/components/tooltip_selector'; +import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta'; import { EuiTitle, EuiPanel, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js similarity index 92% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js rename to x-pack/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js index 5a2124622694c..b0f93b2e2713f 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js @@ -9,13 +9,16 @@ import React from 'react'; import { AbstractTMSSource } from '../tms_source'; import { VectorTileLayer } from '../../vector_tile_layer'; -import { getEMSClient } from '../../../meta'; +import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta'; import { TileServiceSelect } from './tile_service_select'; import { UpdateSourceEditor } from './update_source_editor'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../common/i18n_getters'; -import { EMS_TMS } from '../../../../common/constants'; -import { getInjectedVarFunc, getUiSettings } from '../../../kibana_services'; +import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; +import { EMS_TMS } from '../../../../../../legacy/plugins/maps/common/constants'; +import { + getInjectedVarFunc, + getUiSettings, +} from '../../../../../../legacy/plugins/maps/public/kibana_services'; export class EMSTMSSource extends AbstractTMSSource { static type = EMS_TMS; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.test.js b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.test.js rename to x-pack/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/index.js b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/index.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/index.js rename to x-pack/plugins/maps/public/layers/sources/ems_tms_source/index.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js rename to x-pack/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js index 337fc7aa46693..ca28ef69650bf 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiSelect, EuiFormRow } from '@elastic/eui'; -import { getEMSClient } from '../../../meta'; +import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta'; import { getEmsUnavailableMessage } from '../ems_unavailable_message'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/update_source_editor.js b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/update_source_editor.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_tms_source/update_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/ems_tms_source/update_source_editor.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/ems_unavailable_message.js b/x-pack/plugins/maps/public/layers/sources/ems_unavailable_message.js similarity index 89% rename from x-pack/legacy/plugins/maps/public/layers/sources/ems_unavailable_message.js rename to x-pack/plugins/maps/public/layers/sources/ems_unavailable_message.js index bc50890a0f4a3..7b28d47345458 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/ems_unavailable_message.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_unavailable_message.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getInjectedVarFunc } from '../../kibana_services'; +import { getInjectedVarFunc } from '../../../../../legacy/plugins/maps/public/kibana_services'; import { i18n } from '@kbn/i18n'; export function getEmsUnavailableMessage() { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.d.ts b/x-pack/plugins/maps/public/layers/sources/es_agg_source.d.ts similarity index 83% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.d.ts rename to x-pack/plugins/maps/public/layers/sources/es_agg_source.d.ts index 99ee1ec652b54..f78a70c9304fd 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_agg_source.d.ts @@ -6,9 +6,9 @@ import { IESSource } from './es_source'; import { AbstractESSource } from './es_source'; -import { AGG_TYPE } from '../../../common/constants'; +import { AGG_TYPE } from '../../../../../legacy/plugins/maps/common/constants'; import { IESAggField } from '../fields/es_agg_field'; -import { AbstractESAggSourceDescriptor } from '../../../common/descriptor_types'; +import { AbstractESAggSourceDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; export interface IESAggSource extends IESSource { getAggKey(aggType: AGG_TYPE, fieldName: string): string; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.js b/x-pack/plugins/maps/public/layers/sources/es_agg_source.js similarity index 98% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.js rename to x-pack/plugins/maps/public/layers/sources/es_agg_source.js index 9f4b89cadc777..995b98649acc5 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_agg_source.js @@ -13,7 +13,7 @@ import { COUNT_PROP_LABEL, COUNT_PROP_NAME, FIELD_ORIGIN, -} from '../../../common/constants'; +} from '../../../../../legacy/plugins/maps/common/constants'; export const AGG_DELIMITER = '_of_'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.test.ts b/x-pack/plugins/maps/public/layers/sources/es_agg_source.test.ts similarity index 93% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.test.ts rename to x-pack/plugins/maps/public/layers/sources/es_agg_source.test.ts index 848091586eb9c..7f106380a2dcb 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.test.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_agg_source.test.ts @@ -8,8 +8,8 @@ import { AbstractESAggSource } from './es_agg_source'; import { IField } from '../fields/field'; import { IESAggField } from '../fields/es_agg_field'; import _ from 'lodash'; -import { AGG_TYPE } from '../../../common/constants'; -import { AggDescriptor } from '../../../common/descriptor_types'; +import { AGG_TYPE } from '../../../../../legacy/plugins/maps/common/constants'; +import { AggDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; jest.mock('ui/new_platform'); diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js similarity index 92% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js index 121ce3c7ffe92..926968b058efa 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js @@ -5,10 +5,10 @@ */ import _ from 'lodash'; -import { RENDER_AS } from '../../../../common/constants'; +import { RENDER_AS } from '../../../../../../legacy/plugins/maps/common/constants'; import { getTileBoundingBox } from './geo_tile_utils'; import { extractPropertiesFromBucket } from '../../util/es_agg_utils'; -import { clamp } from '../../../elasticsearch_geo_utils'; +import { clamp } from '../../../../../../legacy/plugins/maps/public/elasticsearch_geo_utils'; const GRID_BUCKET_KEYS_TO_IGNORE = ['key', 'gridCentroid']; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts similarity index 98% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts index e79d8e09fce9b..d4cd19ed6e325 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts @@ -8,7 +8,7 @@ jest.mock('../../../kibana_services', () => {}); // @ts-ignore import { convertCompositeRespToGeoJson, convertRegularRespToGeoJson } from './convert_to_geojson'; -import { RENDER_AS } from '../../../../common/constants'; +import { RENDER_AS } from '../../../../../../legacy/plugins/maps/common/constants'; describe('convertCompositeRespToGeoJson', () => { const esResponse = { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js index 148683269ef78..e18e6fe86b1f0 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js @@ -8,17 +8,20 @@ import _ from 'lodash'; import React, { Fragment, Component } from 'react'; import PropTypes from 'prop-types'; -import { SingleFieldSelect } from '../../../components/single_field_select'; -import { RENDER_AS } from '../../../../common/constants'; -import { getIndexPatternService, getIndexPatternSelectComponent } from '../../../kibana_services'; -import { NoIndexPatternCallout } from '../../../components/no_index_pattern_callout'; +import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/components/single_field_select'; +import { RENDER_AS } from '../../../../../../legacy/plugins/maps/common/constants'; +import { + getIndexPatternService, + getIndexPatternSelectComponent, +} from '../../../../../../legacy/plugins/maps/public/kibana_services'; +import { NoIndexPatternCallout } from '../../../../../../legacy/plugins/maps/public/components/no_index_pattern_callout'; import { i18n } from '@kbn/i18n'; import { EuiFormRow, EuiComboBox, EuiSpacer } from '@elastic/eui'; import { AGGREGATABLE_GEO_FIELD_TYPES, getAggregatableGeoFields, -} from '../../../index_pattern_util'; +} from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; const requestTypeOptions = [ { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts similarity index 79% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts index 3f596cea1ae39..41c2cfc266ad2 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts @@ -5,8 +5,8 @@ */ import { AbstractESAggSource } from '../es_agg_source'; -import { ESGeoGridSourceDescriptor } from '../../../../common/descriptor_types'; -import { GRID_RESOLUTION, RENDER_AS } from '../../../../common/constants'; +import { ESGeoGridSourceDescriptor } from '../../../../../../legacy/plugins/maps/common/descriptor_types'; +import { GRID_RESOLUTION, RENDER_AS } from '../../../../../../legacy/plugins/maps/common/constants'; export class ESGeoGridSource extends AbstractESAggSource { static createDescriptor({ diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js similarity index 98% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js index 405c8a61bfca6..2e27d467d51f8 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js @@ -25,9 +25,9 @@ import { GRID_RESOLUTION, VECTOR_STYLES, FIELD_ORIGIN, -} from '../../../../common/constants'; +} from '../../../../../../legacy/plugins/maps/common/constants'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../common/i18n_getters'; +import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; import { AbstractESAggSource } from '../es_agg_source'; import { DynamicStyleProperty } from '../../styles/vector/properties/dynamic_style_property'; import { StaticStyleProperty } from '../../styles/vector/properties/static_style_property'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts similarity index 90% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts index 727435c3cbfef..2d73102fc9e93 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts @@ -7,7 +7,11 @@ jest.mock('../../../kibana_services', () => {}); jest.mock('ui/new_platform'); import { ESGeoGridSource } from './es_geo_grid_source'; -import { ES_GEO_GRID, GRID_RESOLUTION, RENDER_AS } from '../../../../common/constants'; +import { + ES_GEO_GRID, + GRID_RESOLUTION, + RENDER_AS, +} from '../../../../../../legacy/plugins/maps/common/constants'; describe('ESGeoGridSource', () => { const geogridSource = new ESGeoGridSource( diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js similarity index 94% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js index 251e33b9579cb..a3b99ebdabfbf 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js @@ -5,8 +5,8 @@ */ import _ from 'lodash'; -import { DECIMAL_DEGREES_PRECISION } from '../../../../common/constants'; -import { clampToLatBounds } from '../../../elasticsearch_geo_utils'; +import { DECIMAL_DEGREES_PRECISION } from '../../../../../../legacy/plugins/maps/common/constants'; +import { clampToLatBounds } from '../../../../../../legacy/plugins/maps/public/elasticsearch_geo_utils'; const ZOOM_TILE_KEY_INDEX = 0; const X_TILE_KEY_INDEX = 1; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.test.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.test.js rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/index.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/index.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/index.js rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/index.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js similarity index 93% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js index b2314dd007509..e7842350b745e 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { GRID_RESOLUTION } from '../../../../common/constants'; +import { GRID_RESOLUTION } from '../../../../../../legacy/plugins/maps/common/constants'; import { EuiSelect, EuiFormRow } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js similarity index 89% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js index 269c2a8b8633a..cf15266ba5729 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js @@ -6,15 +6,15 @@ import React, { Fragment, Component } from 'react'; -import { RENDER_AS } from '../../../../common/constants'; -import { MetricsEditor } from '../../../components/metrics_editor'; -import { getIndexPatternService } from '../../../kibana_services'; +import { RENDER_AS } from '../../../../../../legacy/plugins/maps/common/constants'; +import { MetricsEditor } from '../../../../../../legacy/plugins/maps/public/components/metrics_editor'; +import { getIndexPatternService } from '../../../../../../legacy/plugins/maps/public/kibana_services'; import { ResolutionEditor } from './resolution_editor'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui'; import { isMetricCountable } from '../../util/is_metric_countable'; -import { indexPatterns } from '../../../../../../../../src/plugins/data/public'; +import { indexPatterns } from '../../../../../../../src/plugins/data/public'; export class UpdateSourceEditor extends Component { state = { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.js b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.js rename to x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.test.ts b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.test.ts similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.test.ts rename to x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.test.ts diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js similarity index 94% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js index a4af1a3c19c83..c4d0414b94015 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js @@ -8,8 +8,11 @@ import _ from 'lodash'; import React, { Fragment, Component } from 'react'; import PropTypes from 'prop-types'; -import { SingleFieldSelect } from '../../../components/single_field_select'; -import { getIndexPatternService, getIndexPatternSelectComponent } from '../../../kibana_services'; +import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/components/single_field_select'; +import { + getIndexPatternService, + getIndexPatternSelectComponent, +} from '../../../../../../legacy/plugins/maps/public/kibana_services'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -17,7 +20,7 @@ import { EuiFormRow, EuiCallOut } from '@elastic/eui'; import { AGGREGATABLE_GEO_FIELD_TYPES, getAggregatableGeoFields, -} from '../../../index_pattern_util'; +} from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; export class CreateSourceEditor extends Component { static propTypes = { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js rename to x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js index 5f6cc0a46dfb2..aafa5bc0c4220 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js @@ -19,13 +19,13 @@ import { ES_PEW_PEW, COUNT_PROP_NAME, VECTOR_STYLES, -} from '../../../../common/constants'; -import { getDataSourceLabel } from '../../../../common/i18n_getters'; +} from '../../../../../../legacy/plugins/maps/common/constants'; +import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; import { convertToLines } from './convert_to_lines'; import { AbstractESAggSource } from '../es_agg_source'; import { DynamicStyleProperty } from '../../styles/vector/properties/dynamic_style_property'; import { COLOR_GRADIENTS } from '../../styles/color_utils'; -import { indexPatterns } from '../../../../../../../../src/plugins/data/public'; +import { indexPatterns } from '../../../../../../../src/plugins/data/public'; const MAX_GEOTILE_LEVEL = 29; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js similarity index 87% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js index ce1f53c33ba53..f4760941f8d0b 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js @@ -6,12 +6,12 @@ import React, { Component, Fragment } from 'react'; -import { MetricsEditor } from '../../../components/metrics_editor'; -import { getIndexPatternService } from '../../../kibana_services'; +import { MetricsEditor } from '../../../../../../legacy/plugins/maps/public/components/metrics_editor'; +import { getIndexPatternService } from '../../../../../../legacy/plugins/maps/public/kibana_services'; import { i18n } from '@kbn/i18n'; import { EuiPanel, EuiTitle, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { indexPatterns } from '../../../../../../../../src/plugins/data/public'; +import { indexPatterns } from '../../../../../../../src/plugins/data/public'; export class UpdateSourceEditor extends Component { state = { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/scaling_form.test.tsx.snap b/x-pack/plugins/maps/public/layers/sources/es_search_source/__snapshots__/scaling_form.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/scaling_form.test.tsx.snap rename to x-pack/plugins/maps/public/layers/sources/es_search_source/__snapshots__/scaling_form.test.tsx.snap diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap b/x-pack/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap rename to x-pack/plugins/maps/public/layers/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/constants.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/constants.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/constants.js rename to x-pack/plugins/maps/public/layers/sources/es_search_source/constants.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js index 73bea574ace28..1c7fe97beb7fa 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js @@ -9,15 +9,21 @@ import React, { Fragment, Component } from 'react'; import PropTypes from 'prop-types'; import { EuiFormRow, EuiSpacer } from '@elastic/eui'; -import { SingleFieldSelect } from '../../../components/single_field_select'; -import { getIndexPatternService, getIndexPatternSelectComponent } from '../../../kibana_services'; -import { NoIndexPatternCallout } from '../../../components/no_index_pattern_callout'; +import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/components/single_field_select'; +import { + getIndexPatternService, + getIndexPatternSelectComponent, +} from '../../../../../../legacy/plugins/maps/public/kibana_services'; +import { NoIndexPatternCallout } from '../../../../../../legacy/plugins/maps/public/components/no_index_pattern_callout'; import { i18n } from '@kbn/i18n'; -import { ES_GEO_FIELD_TYPE, SCALING_TYPES } from '../../../../common/constants'; +import { + ES_GEO_FIELD_TYPE, + SCALING_TYPES, +} from '../../../../../../legacy/plugins/maps/common/constants'; import { DEFAULT_FILTER_BY_MAP_BOUNDS } from './constants'; -import { indexPatterns } from '../../../../../../../../src/plugins/data/public'; +import { indexPatterns } from '../../../../../../../src/plugins/data/public'; import { ScalingForm } from './scaling_form'; -import { getTermsFields } from '../../../index_pattern_util'; +import { getTermsFields } from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; function getGeoFields(fields) { return fields.filter(field => { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts similarity index 80% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts rename to x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts index 0a4e48a195ec6..58f9d4a43d49f 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts @@ -5,7 +5,7 @@ */ import { AbstractESSource } from '../es_source'; -import { ESSearchSourceDescriptor } from '../../../../common/descriptor_types'; +import { ESSearchSourceDescriptor } from '../../../../../../legacy/plugins/maps/common/descriptor_types'; export class ESSearchSource extends AbstractESSource { constructor(sourceDescriptor: Partial, inspectorAdapters: unknown); diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.js similarity index 97% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.js rename to x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.js index cd44ef49623fa..fdcd6d5a144db 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.js @@ -10,10 +10,10 @@ import uuid from 'uuid/v4'; import { VECTOR_SHAPE_TYPES } from '../vector_feature_types'; import { AbstractESSource } from '../es_source'; -import { SearchSource } from '../../../kibana_services'; +import { SearchSource } from '../../../../../../legacy/plugins/maps/public/kibana_services'; import { VectorStyle } from '../../styles/vector/vector_style'; import { VectorLayer } from '../../vector_layer'; -import { hitsToGeoJson } from '../../../elasticsearch_geo_utils'; +import { hitsToGeoJson } from '../../../../../../legacy/plugins/maps/public/elasticsearch_geo_utils'; import { CreateSourceEditor } from './create_source_editor'; import { UpdateSourceEditor } from './update_source_editor'; import { @@ -22,10 +22,10 @@ import { DEFAULT_MAX_BUCKETS_LIMIT, SORT_ORDER, SCALING_TYPES, -} from '../../../../common/constants'; +} from '../../../../../../legacy/plugins/maps/common/constants'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../common/i18n_getters'; -import { getSourceFields } from '../../../index_pattern_util'; +import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; +import { getSourceFields } from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; import { loadIndexSettings } from './load_index_settings'; import { BlendedVectorLayer } from '../../blended_vector_layer'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts similarity index 74% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts rename to x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts index 2197e24aedb59..452bd8cba8c73 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts @@ -8,8 +8,8 @@ jest.mock('../../../kibana_services'); import { ESSearchSource } from './es_search_source'; import { VectorLayer } from '../../vector_layer'; -import { ES_SEARCH, SCALING_TYPES } from '../../../../common/constants'; -import { ESSearchSourceDescriptor } from '../../../../common/descriptor_types'; +import { ES_SEARCH, SCALING_TYPES } from '../../../../../../legacy/plugins/maps/common/constants'; +import { ESSearchSourceDescriptor } from '../../../../../../legacy/plugins/maps/common/descriptor_types'; const descriptor: ESSearchSourceDescriptor = { type: ES_SEARCH, @@ -21,7 +21,7 @@ const descriptor: ESSearchSourceDescriptor = { describe('ES Search Source', () => { beforeEach(() => { - require('../../../kibana_services').getUiSettings = () => ({ + require('../../../../../../legacy/plugins/maps/public/kibana_services').getUiSettings = () => ({ get: jest.fn(), }); }); diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/index.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/index.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/index.js rename to x-pack/plugins/maps/public/layers/sources/es_search_source/index.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js rename to x-pack/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js index 811291de26d35..429190bdc3eae 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js @@ -8,8 +8,8 @@ import { DEFAULT_MAX_RESULT_WINDOW, DEFAULT_MAX_INNER_RESULT_WINDOW, INDEX_SETTINGS_API_PATH, -} from '../../../../common/constants'; -import { getHttp, getToasts } from '../../../kibana_services'; +} from '../../../../../../legacy/plugins/maps/common/constants'; +import { getHttp, getToasts } from '../../../../../../legacy/plugins/maps/public/kibana_services'; import { i18n } from '@kbn/i18n'; let toastDisplayed = false; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx similarity index 93% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx rename to x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx index 03f29685891ec..b851c1137a058 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { ScalingForm } from './scaling_form'; -import { SCALING_TYPES } from '../../../../common/constants'; +import { SCALING_TYPES } from '../../../../../../legacy/plugins/maps/common/constants'; const defaultProps = { filterByMapBounds: true, diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx similarity index 89% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx rename to x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx index c5950f1132974..fd7846a91fa22 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx @@ -17,24 +17,27 @@ import { import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; // @ts-ignore -import { SingleFieldSelect } from '../../../components/single_field_select'; +import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/components/single_field_select'; // @ts-ignore -import { indexPatternService } from '../../../kibana_services'; +import { indexPatternService } from '../../../../../../legacy/plugins/maps/public/kibana_services'; // @ts-ignore -import { getTermsFields, getSourceFields } from '../../../index_pattern_util'; +import { + getTermsFields, + getSourceFields, +} from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; // @ts-ignore -import { ValidatedRange } from '../../../components/validated_range'; +import { ValidatedRange } from '../../../../../../legacy/plugins/maps/public/components/validated_range'; import { DEFAULT_MAX_INNER_RESULT_WINDOW, DEFAULT_MAX_RESULT_WINDOW, SCALING_TYPES, LAYER_TYPE, -} from '../../../../common/constants'; +} from '../../../../../../legacy/plugins/maps/common/constants'; // @ts-ignore import { loadIndexSettings } from './load_index_settings'; -import { IFieldType } from '../../../../../../../../src/plugins/data/public'; -import { OnSourceChangeArgs } from '../../../connected_components/layer_panel/view'; +import { IFieldType } from '../../../../../../../src/plugins/data/public'; +import { OnSourceChangeArgs } from '../../../../../../legacy/plugins/maps/public/connected_components/layer_panel/view'; interface Props { filterByMapBounds: boolean; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js index 9c92ec5801e49..9a735e4e7f32a 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js @@ -7,16 +7,19 @@ import React, { Fragment, Component } from 'react'; import PropTypes from 'prop-types'; import { EuiFormRow, EuiSelect, EuiTitle, EuiPanel, EuiSpacer } from '@elastic/eui'; -import { SingleFieldSelect } from '../../../components/single_field_select'; -import { TooltipSelector } from '../../../components/tooltip_selector'; +import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/components/single_field_select'; +import { TooltipSelector } from '../../../../../../legacy/plugins/maps/public/components/tooltip_selector'; -import { getIndexPatternService } from '../../../kibana_services'; +import { getIndexPatternService } from '../../../../../../legacy/plugins/maps/public/kibana_services'; import { i18n } from '@kbn/i18n'; -import { getTermsFields, getSourceFields } from '../../../index_pattern_util'; -import { SORT_ORDER } from '../../../../common/constants'; +import { + getTermsFields, + getSourceFields, +} from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; +import { SORT_ORDER } from '../../../../../../legacy/plugins/maps/common/constants'; import { ESDocField } from '../../fields/es_doc_field'; import { FormattedMessage } from '@kbn/i18n/react'; -import { indexPatterns } from '../../../../../../../../src/plugins/data/public'; +import { indexPatterns } from '../../../../../../../src/plugins/data/public'; import { ScalingForm } from './scaling_form'; export class UpdateSourceEditor extends Component { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js similarity index 93% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js rename to x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js index 65a91ce03994a..8b95726be326f 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js @@ -16,7 +16,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { UpdateSourceEditor } from './update_source_editor'; -import { SCALING_TYPES } from '../../../../common/constants'; +import { SCALING_TYPES } from '../../../../../../legacy/plugins/maps/common/constants'; const defaultProps = { indexPatternId: 'indexPattern1', diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_source.d.ts b/x-pack/plugins/maps/public/layers/sources/es_source.d.ts similarity index 85% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_source.d.ts rename to x-pack/plugins/maps/public/layers/sources/es_source.d.ts index ffd1d343b59e0..542c9f01e5144 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_source.d.ts @@ -6,8 +6,8 @@ import { AbstractVectorSource } from './vector_source'; import { IVectorSource } from './vector_source'; -import { IndexPattern, SearchSource } from '../../../../../../../src/plugins/data/public'; -import { VectorSourceRequestMeta } from '../../../common/descriptor_types'; +import { IndexPattern, SearchSource } from '../../../../../../src/plugins/data/public'; +import { VectorSourceRequestMeta } from '../../../../../legacy/plugins/maps/common/descriptor_types'; export interface IESSource extends IVectorSource { getId(): string; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_source.js b/x-pack/plugins/maps/public/layers/sources/es_source.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_source.js rename to x-pack/plugins/maps/public/layers/sources/es_source.js index 9dc3067a70436..099de3a1e0644 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_source.js @@ -11,14 +11,14 @@ import { getIndexPatternService, SearchSource, getTimeFilter, -} from '../../kibana_services'; -import { createExtentFilter } from '../../elasticsearch_geo_utils'; +} from '../../../../../legacy/plugins/maps/public/kibana_services'; +import { createExtentFilter } from '../../../../../legacy/plugins/maps/public/elasticsearch_geo_utils'; import _ from 'lodash'; import { i18n } from '@kbn/i18n'; import uuid from 'uuid/v4'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { copyPersistentState } from '../../../../../../plugins/maps/public/reducers/util'; -import { ES_GEO_FIELD_TYPE } from '../../../common/constants'; +import { copyPersistentState } from '../../reducers/util'; +import { ES_GEO_FIELD_TYPE } from '../../../../../legacy/plugins/maps/common/constants'; import { DataRequestAbortError } from '../util/data_request'; import { expandToTileBoundaries } from './es_geo_grid_source/geo_tile_utils'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_term_source.d.ts b/x-pack/plugins/maps/public/layers/sources/es_term_source.d.ts similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_term_source.d.ts rename to x-pack/plugins/maps/public/layers/sources/es_term_source.d.ts diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_term_source.js b/x-pack/plugins/maps/public/layers/sources/es_term_source.js similarity index 97% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_term_source.js rename to x-pack/plugins/maps/public/layers/sources/es_term_source.js index 3ce0fb58aba19..dbe4759852292 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/es_term_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_term_source.js @@ -7,7 +7,11 @@ import _ from 'lodash'; import { i18n } from '@kbn/i18n'; -import { DEFAULT_MAX_BUCKETS_LIMIT, FIELD_ORIGIN, AGG_TYPE } from '../../../common/constants'; +import { + DEFAULT_MAX_BUCKETS_LIMIT, + FIELD_ORIGIN, + AGG_TYPE, +} from '../../../../../legacy/plugins/maps/common/constants'; import { ESDocField } from '../fields/es_doc_field'; import { AbstractESAggSource, AGG_DELIMITER } from './es_agg_source'; import { getField, addFieldToDSL, extractPropertiesFromBucket } from '../util/es_agg_utils'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/es_term_source.test.js b/x-pack/plugins/maps/public/layers/sources/es_term_source.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/es_term_source.test.js rename to x-pack/plugins/maps/public/layers/sources/es_term_source.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js similarity index 94% rename from x-pack/legacy/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js index 5e28916e79f3f..2fffec9e97c9d 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js @@ -7,7 +7,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { EuiSelect, EuiFormRow } from '@elastic/eui'; -import { getKibanaRegionList } from '../../../meta'; +import { getKibanaRegionList } from '../../../../../../legacy/plugins/maps/public/meta'; import { i18n } from '@kbn/i18n'; export function CreateSourceEditor({ onSourceConfigChange }) { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_regionmap_source/index.js b/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/index.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/kibana_regionmap_source/index.js rename to x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/index.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.d.ts b/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.d.ts similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.d.ts rename to x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.d.ts diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js b/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js similarity index 92% rename from x-pack/legacy/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js rename to x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js index 276a3377aaae2..d26181899d0f4 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js +++ b/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js @@ -7,10 +7,10 @@ import { AbstractVectorSource } from '../vector_source'; import React from 'react'; import { CreateSourceEditor } from './create_source_editor'; -import { getKibanaRegionList } from '../../../meta'; +import { getKibanaRegionList } from '../../../../../../legacy/plugins/maps/public/meta'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../common/i18n_getters'; -import { FIELD_ORIGIN } from '../../../../common/constants'; +import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; +import { FIELD_ORIGIN } from '../../../../../../legacy/plugins/maps/common/constants'; import { KibanaRegionField } from '../../fields/kibana_region_field'; export class KibanaRegionmapSource extends AbstractVectorSource { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js similarity index 93% rename from x-pack/legacy/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js index a0a507ff9d32d..85804f4cfc255 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js @@ -8,7 +8,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { EuiFieldText, EuiFormRow } from '@elastic/eui'; -import { getKibanaTileMap } from '../../../meta'; +import { getKibanaTileMap } from '../../../../../../legacy/plugins/maps/public/meta'; import { i18n } from '@kbn/i18n'; export function CreateSourceEditor({ onSourceConfigChange }) { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_tilemap_source/index.js b/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/index.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/kibana_tilemap_source/index.js rename to x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/index.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js b/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js similarity index 93% rename from x-pack/legacy/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js rename to x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js index 21ab2ba42c7bb..f4f76a22ca4d1 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js +++ b/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js @@ -7,9 +7,9 @@ import React from 'react'; import { AbstractTMSSource } from '../tms_source'; import { TileLayer } from '../../tile_layer'; import { CreateSourceEditor } from './create_source_editor'; -import { getKibanaTileMap } from '../../../meta'; +import { getKibanaTileMap } from '../../../../../../legacy/plugins/maps/public/meta'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../common/i18n_getters'; +import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; import _ from 'lodash'; export class KibanaTilemapSource extends AbstractTMSSource { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/source.d.ts b/x-pack/plugins/maps/public/layers/sources/source.d.ts similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/sources/source.d.ts rename to x-pack/plugins/maps/public/layers/sources/source.d.ts index e1706ad7b7d77..14fac48d2f17b 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/source.d.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AbstractSourceDescriptor } from '../../../common/descriptor_types'; +import { AbstractSourceDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; import { ILayer } from '../layer'; export interface ISource { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/source.js b/x-pack/plugins/maps/public/layers/sources/source.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/sources/source.js rename to x-pack/plugins/maps/public/layers/sources/source.js index b6b6c10831bb5..368de421e23ce 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/source.js +++ b/x-pack/plugins/maps/public/layers/sources/source.js @@ -5,7 +5,7 @@ */ // eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { copyPersistentState } from '../../../../../../plugins/maps/public/reducers/util'; +import { copyPersistentState } from '../../reducers/util'; export class AbstractSource { static isIndexingSource = false; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/tms_source.d.ts b/x-pack/plugins/maps/public/layers/sources/tms_source.d.ts similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/tms_source.d.ts rename to x-pack/plugins/maps/public/layers/sources/tms_source.d.ts diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/tms_source.js b/x-pack/plugins/maps/public/layers/sources/tms_source.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/tms_source.js rename to x-pack/plugins/maps/public/layers/sources/tms_source.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/vector_feature_types.js b/x-pack/plugins/maps/public/layers/sources/vector_feature_types.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/vector_feature_types.js rename to x-pack/plugins/maps/public/layers/sources/vector_feature_types.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/vector_source.d.ts b/x-pack/plugins/maps/public/layers/sources/vector_source.d.ts similarity index 92% rename from x-pack/legacy/plugins/maps/public/layers/sources/vector_source.d.ts rename to x-pack/plugins/maps/public/layers/sources/vector_source.d.ts index 7a747da244233..4248c9b498070 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/vector_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/vector_source.d.ts @@ -8,7 +8,7 @@ import { FeatureCollection } from 'geojson'; import { AbstractSource, ISource } from './source'; import { IField } from '../fields/field'; -import { ESSearchSourceResponseMeta } from '../../../common/descriptor_types'; +import { ESSearchSourceResponseMeta } from '../../../../../legacy/plugins/maps/common/descriptor_types'; export type GeoJsonFetchMeta = ESSearchSourceResponseMeta; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/vector_source.js b/x-pack/plugins/maps/public/layers/sources/vector_source.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/vector_source.js rename to x-pack/plugins/maps/public/layers/sources/vector_source.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/wms_source/index.js b/x-pack/plugins/maps/public/layers/sources/wms_source/index.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/wms_source/index.js rename to x-pack/plugins/maps/public/layers/sources/wms_source/index.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/wms_source/wms_client.js b/x-pack/plugins/maps/public/layers/sources/wms_source/wms_client.js similarity index 98% rename from x-pack/legacy/plugins/maps/public/layers/sources/wms_source/wms_client.js rename to x-pack/plugins/maps/public/layers/sources/wms_source/wms_client.js index 2d897f7c9227b..40c33182e2ec7 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/wms_source/wms_client.js +++ b/x-pack/plugins/maps/public/layers/sources/wms_source/wms_client.js @@ -5,7 +5,7 @@ */ import _ from 'lodash'; -import { parseXmlString } from '../../../../common/parse_xml_string'; +import { parseXmlString } from '../../../../../../legacy/plugins/maps/common/parse_xml_string'; import fetch from 'node-fetch'; import { parse, format } from 'url'; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/wms_source/wms_client.test.js b/x-pack/plugins/maps/public/layers/sources/wms_source/wms_client.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/wms_source/wms_client.test.js rename to x-pack/plugins/maps/public/layers/sources/wms_source/wms_client.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/wms_source/wms_create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/wms_source/wms_create_source_editor.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/sources/wms_source/wms_create_source_editor.js rename to x-pack/plugins/maps/public/layers/sources/wms_source/wms_create_source_editor.js diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/wms_source/wms_source.js b/x-pack/plugins/maps/public/layers/sources/wms_source/wms_source.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/sources/wms_source/wms_source.js rename to x-pack/plugins/maps/public/layers/sources/wms_source/wms_source.js index 61955df94e451..a8d5dfa9beee3 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/wms_source/wms_source.js +++ b/x-pack/plugins/maps/public/layers/sources/wms_source/wms_source.js @@ -10,7 +10,10 @@ import { AbstractTMSSource } from '../tms_source'; import { TileLayer } from '../../tile_layer'; import { WMSCreateSourceEditor } from './wms_create_source_editor'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel, getUrlLabel } from '../../../../common/i18n_getters'; +import { + getDataSourceLabel, + getUrlLabel, +} from '../../../../../../legacy/plugins/maps/common/i18n_getters'; import { WmsClient } from './wms_client'; export class WMSSource extends AbstractTMSSource { diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/xyz_tms_source.d.ts b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.d.ts similarity index 81% rename from x-pack/legacy/plugins/maps/public/layers/sources/xyz_tms_source.d.ts rename to x-pack/plugins/maps/public/layers/sources/xyz_tms_source.d.ts index 579c9debeab3e..efb8db7ee7153 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/xyz_tms_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.d.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { AbstractTMSSource } from './tms_source'; -import { XYZTMSSourceDescriptor } from '../../../common/descriptor_types'; +import { XYZTMSSourceDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; export class XYZTMSSource extends AbstractTMSSource { constructor(sourceDescriptor: XYZTMSSourceDescriptor, inspectorAdapters: unknown); diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/xyz_tms_source.js b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/sources/xyz_tms_source.js rename to x-pack/plugins/maps/public/layers/sources/xyz_tms_source.js index 354883372e244..10decaa5e7ade 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/xyz_tms_source.js +++ b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.js @@ -10,9 +10,12 @@ import { EuiFieldText, EuiFormRow } from '@elastic/eui'; import { AbstractTMSSource } from './tms_source'; import { TileLayer } from '../tile_layer'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel, getUrlLabel } from '../../../common/i18n_getters'; +import { + getDataSourceLabel, + getUrlLabel, +} from '../../../../../legacy/plugins/maps/common/i18n_getters'; import _ from 'lodash'; -import { EMS_XYZ } from '../../../common/constants'; +import { EMS_XYZ } from '../../../../../legacy/plugins/maps/common/constants'; export class XYZTMSSource extends AbstractTMSSource { static type = EMS_XYZ; diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/xyz_tms_source.test.ts b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.test.ts similarity index 84% rename from x-pack/legacy/plugins/maps/public/layers/sources/xyz_tms_source.test.ts rename to x-pack/plugins/maps/public/layers/sources/xyz_tms_source.test.ts index e5ab5e57122ba..ae010141fb940 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/xyz_tms_source.test.ts +++ b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.test.ts @@ -7,8 +7,8 @@ import { XYZTMSSource } from './xyz_tms_source'; import { ILayer } from '../layer'; import { TileLayer } from '../tile_layer'; -import { EMS_XYZ } from '../../../common/constants'; -import { XYZTMSSourceDescriptor } from '../../../common/descriptor_types'; +import { EMS_XYZ } from '../../../../../legacy/plugins/maps/common/constants'; +import { XYZTMSSourceDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; const descriptor: XYZTMSSourceDescriptor = { type: EMS_XYZ, diff --git a/x-pack/plugins/maps/public/layers/styles/_index.scss b/x-pack/plugins/maps/public/layers/styles/_index.scss new file mode 100644 index 0000000000000..a1c4c297a3ac1 --- /dev/null +++ b/x-pack/plugins/maps/public/layers/styles/_index.scss @@ -0,0 +1,4 @@ +@import 'components/color_gradient'; +@import 'vector/components/style_prop_editor'; +@import 'vector/components/color/color_stops'; +@import 'vector/components/symbol/icon_select'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/abstract_style.js b/x-pack/plugins/maps/public/layers/styles/abstract_style.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/abstract_style.js rename to x-pack/plugins/maps/public/layers/styles/abstract_style.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/color_utils.js b/x-pack/plugins/maps/public/layers/styles/color_utils.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/styles/color_utils.js rename to x-pack/plugins/maps/public/layers/styles/color_utils.js index 09c7d76db1691..81d63eaadb673 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/color_utils.js +++ b/x-pack/plugins/maps/public/layers/styles/color_utils.js @@ -9,8 +9,8 @@ import tinycolor from 'tinycolor2'; import chroma from 'chroma-js'; import { euiPaletteColorBlind } from '@elastic/eui/lib/services'; import { ColorGradient } from './components/color_gradient'; -import { COLOR_PALETTE_MAX_SIZE } from '../../../common/constants'; -import { vislibColorMaps } from '../../../../../../../src/plugins/charts/public'; +import { COLOR_PALETTE_MAX_SIZE } from '../../../../../legacy/plugins/maps/common/constants'; +import { vislibColorMaps } from '../../../../../../src/plugins/charts/public'; const GRADIENT_INTERVALS = 8; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/color_utils.test.js b/x-pack/plugins/maps/public/layers/styles/color_utils.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/color_utils.test.js rename to x-pack/plugins/maps/public/layers/styles/color_utils.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/components/_color_gradient.scss b/x-pack/plugins/maps/public/layers/styles/components/_color_gradient.scss similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/components/_color_gradient.scss rename to x-pack/plugins/maps/public/layers/styles/components/_color_gradient.scss diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/components/color_gradient.js b/x-pack/plugins/maps/public/layers/styles/components/color_gradient.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/components/color_gradient.js rename to x-pack/plugins/maps/public/layers/styles/components/color_gradient.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/components/ranged_style_legend_row.js b/x-pack/plugins/maps/public/layers/styles/components/ranged_style_legend_row.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/components/ranged_style_legend_row.js rename to x-pack/plugins/maps/public/layers/styles/components/ranged_style_legend_row.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.js.snap b/x-pack/plugins/maps/public/layers/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.js.snap similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.js.snap rename to x-pack/plugins/maps/public/layers/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.js.snap diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/heatmap/components/heatmap_constants.js b/x-pack/plugins/maps/public/layers/styles/heatmap/components/heatmap_constants.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/heatmap/components/heatmap_constants.js rename to x-pack/plugins/maps/public/layers/styles/heatmap/components/heatmap_constants.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/heatmap/components/heatmap_style_editor.js b/x-pack/plugins/maps/public/layers/styles/heatmap/components/heatmap_style_editor.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/heatmap/components/heatmap_style_editor.js rename to x-pack/plugins/maps/public/layers/styles/heatmap/components/heatmap_style_editor.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/heatmap/components/heatmap_style_editor.test.js b/x-pack/plugins/maps/public/layers/styles/heatmap/components/heatmap_style_editor.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/heatmap/components/heatmap_style_editor.test.js rename to x-pack/plugins/maps/public/layers/styles/heatmap/components/heatmap_style_editor.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/heatmap/components/legend/heatmap_legend.js b/x-pack/plugins/maps/public/layers/styles/heatmap/components/legend/heatmap_legend.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/heatmap/components/legend/heatmap_legend.js rename to x-pack/plugins/maps/public/layers/styles/heatmap/components/legend/heatmap_legend.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/heatmap/heatmap_style.js b/x-pack/plugins/maps/public/layers/styles/heatmap/heatmap_style.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/styles/heatmap/heatmap_style.js rename to x-pack/plugins/maps/public/layers/styles/heatmap/heatmap_style.js index d769fe0da9ec2..35338d86ff767 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/heatmap/heatmap_style.js +++ b/x-pack/plugins/maps/public/layers/styles/heatmap/heatmap_style.js @@ -9,7 +9,10 @@ import { AbstractStyle } from '../abstract_style'; import { HeatmapStyleEditor } from './components/heatmap_style_editor'; import { HeatmapLegend } from './components/legend/heatmap_legend'; import { DEFAULT_HEATMAP_COLOR_RAMP_NAME } from './components/heatmap_constants'; -import { LAYER_STYLE_TYPE, GRID_RESOLUTION } from '../../../../common/constants'; +import { + LAYER_STYLE_TYPE, + GRID_RESOLUTION, +} from '../../../../../../legacy/plugins/maps/common/constants'; import { getOrdinalColorRampStops } from '../color_utils'; import { i18n } from '@kbn/i18n'; import { EuiIcon } from '@elastic/eui'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/_style_prop_editor.scss b/x-pack/plugins/maps/public/layers/styles/vector/components/_style_prop_editor.scss similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/_style_prop_editor.scss rename to x-pack/plugins/maps/public/layers/styles/vector/components/_style_prop_editor.scss diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/_color_stops.scss b/x-pack/plugins/maps/public/layers/styles/vector/components/color/_color_stops.scss similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/_color_stops.scss rename to x-pack/plugins/maps/public/layers/styles/vector/components/color/_color_stops.scss diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js b/x-pack/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js similarity index 98% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js index bf57306df5697..c944f5e759165 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import { EuiSpacer, EuiSelect, EuiSuperSelect, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { ColorStopsOrdinal } from './color_stops_ordinal'; -import { COLOR_MAP_TYPE } from '../../../../../../common/constants'; +import { COLOR_MAP_TYPE } from '../../../../../../../../legacy/plugins/maps/common/constants'; import { ColorStopsCategorical } from './color_stops_categorical'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops.js b/x-pack/plugins/maps/public/layers/styles/vector/components/color/color_stops.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/color/color_stops.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_categorical.js b/x-pack/plugins/maps/public/layers/styles/vector/components/color/color_stops_categorical.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_categorical.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/color/color_stops_categorical.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_ordinal.js b/x-pack/plugins/maps/public/layers/styles/vector/components/color/color_stops_ordinal.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_ordinal.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/color/color_stops_ordinal.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_utils.js b/x-pack/plugins/maps/public/layers/styles/vector/components/color/color_stops_utils.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_utils.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/color/color_stops_utils.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js similarity index 97% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js index 5e8f720fcc5e3..836306651737b 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js @@ -9,7 +9,10 @@ import React, { Fragment } from 'react'; import { FieldSelect } from '../field_select'; import { ColorMapSelect } from './color_map_select'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { CATEGORICAL_DATA_TYPES, COLOR_MAP_TYPE } from '../../../../../../common/constants'; +import { + CATEGORICAL_DATA_TYPES, + COLOR_MAP_TYPE, +} from '../../../../../../../../legacy/plugins/maps/common/constants'; import { COLOR_GRADIENTS, COLOR_PALETTES } from '../../../color_utils'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/static_color_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/color/static_color_form.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/static_color_form.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/color/static_color_form.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/vector_style_color_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/color/vector_style_color_editor.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/vector_style_color_editor.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/color/vector_style_color_editor.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx b/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx similarity index 93% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx rename to x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx index 550b3737963d5..988b53c728c8f 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx @@ -11,7 +11,7 @@ import { EuiFormRow, EuiSwitch, EuiSwitchEvent } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FieldMetaPopover } from './field_meta_popover'; import { IDynamicStyleProperty } from '../../properties/dynamic_style_property'; -import { FieldMetaOptions } from '../../../../../../common/descriptor_types'; +import { FieldMetaOptions } from '../../../../../../../../legacy/plugins/maps/common/descriptor_types'; type Props = { styleProperty: IDynamicStyleProperty; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/field_meta_popover.tsx b/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/field_meta_popover.tsx similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/field_meta_popover.tsx rename to x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/field_meta_popover.tsx diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx b/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx similarity index 94% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx rename to x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx index 32a54a45ed4d7..b4f04ed9cefe9 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx @@ -12,8 +12,8 @@ import { i18n } from '@kbn/i18n'; import { DEFAULT_SIGMA } from '../../vector_style_defaults'; import { FieldMetaPopover } from './field_meta_popover'; import { IDynamicStyleProperty } from '../../properties/dynamic_style_property'; -import { FieldMetaOptions } from '../../../../../../common/descriptor_types'; -import { VECTOR_STYLES } from '../../../../../../common/constants'; +import { FieldMetaOptions } from '../../../../../../../../legacy/plugins/maps/common/descriptor_types'; +import { VECTOR_STYLES } from '../../../../../../../../legacy/plugins/maps/common/constants'; function getIsEnableToggleLabel(styleName: string) { switch (styleName) { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_select.js b/x-pack/plugins/maps/public/layers/styles/vector/components/field_select.js similarity index 95% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_select.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/field_select.js index 2f5de507657a5..c4caece047019 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/field_select.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/field_select.js @@ -8,9 +8,9 @@ import PropTypes from 'prop-types'; import React from 'react'; import { EuiComboBox, EuiHighlight, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FIELD_ORIGIN } from '../../../../../common/constants'; +import { FIELD_ORIGIN } from '../../../../../../../legacy/plugins/maps/common/constants'; import { i18n } from '@kbn/i18n'; -import { FieldIcon } from '../../../../../../../../../src/plugins/kibana_react/public'; +import { FieldIcon } from '../../../../../../../../src/plugins/kibana_react/public'; function renderOption(option, searchValue, contentClassName) { return ( diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js b/x-pack/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js index 5d39b423e56e6..5999dfa384003 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js @@ -6,7 +6,7 @@ import { i18n } from '@kbn/i18n'; -import { VECTOR_STYLES } from '../../../../../common/constants'; +import { VECTOR_STYLES } from '../../../../../../../legacy/plugins/maps/common/constants'; export function getDisabledByMessage(styleName) { return i18n.translate('xpack.maps.styles.vector.disabledByMessage', { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/label/dynamic_label_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/label/dynamic_label_form.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/label/dynamic_label_form.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/label/dynamic_label_form.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/label/static_label_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/label/static_label_form.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/label/static_label_form.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/label/static_label_form.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js similarity index 94% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js index b3e3e028c9aeb..2a41c97ec0106 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js @@ -9,7 +9,10 @@ import React from 'react'; import { EuiFormRow, EuiSelect, EuiToolTip } from '@elastic/eui'; import { getVectorStyleLabel, getDisabledByMessage } from '../get_vector_style_label'; import { i18n } from '@kbn/i18n'; -import { LABEL_BORDER_SIZES, VECTOR_STYLES } from '../../../../../../common/constants'; +import { + LABEL_BORDER_SIZES, + VECTOR_STYLES, +} from '../../../../../../../../legacy/plugins/maps/common/constants'; const options = [ { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_editor.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_editor.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_editor.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/__snapshots__/vector_icon.test.js.snap b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/__snapshots__/vector_icon.test.js.snap similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/__snapshots__/vector_icon.test.js.snap rename to x-pack/plugins/maps/public/layers/styles/vector/components/legend/__snapshots__/vector_icon.test.js.snap diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/category.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/category.js similarity index 92% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/category.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/legend/category.js index b0f397b6375ad..5fb91e77bfcfc 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/category.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/category.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { VECTOR_STYLES } from '../../../../../../common/constants'; +import { VECTOR_STYLES } from '../../../../../../../../legacy/plugins/maps/common/constants'; import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import { VectorIcon } from './vector_icon'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/circle_icon.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/circle_icon.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/circle_icon.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/legend/circle_icon.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js similarity index 94% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js index 66a93c7301318..5df980a576795 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js @@ -5,7 +5,10 @@ */ import { getColorRampCenterColor, getColorPalette } from '../../../color_utils'; -import { COLOR_MAP_TYPE, STYLE_TYPE } from '../../../../../../common/constants'; +import { + COLOR_MAP_TYPE, + STYLE_TYPE, +} from '../../../../../../../../legacy/plugins/maps/common/constants'; export function extractColorFromStyleProperty(colorStyleProperty, defaultColor) { if (!colorStyleProperty) { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/line_icon.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/line_icon.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/line_icon.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/legend/line_icon.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/polygon_icon.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/polygon_icon.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/polygon_icon.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/legend/polygon_icon.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/symbol_icon.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/symbol_icon.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/symbol_icon.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/legend/symbol_icon.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/vector_icon.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/vector_icon.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/vector_icon.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/legend/vector_icon.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/vector_icon.test.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/vector_icon.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/vector_icon.test.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/legend/vector_icon.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/vector_style_legend.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/vector_style_legend.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/vector_style_legend.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/legend/vector_style_legend.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/orientation/dynamic_orientation_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/orientation/dynamic_orientation_form.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/orientation/dynamic_orientation_form.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/orientation/dynamic_orientation_form.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/orientation/orientation_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/orientation/orientation_editor.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/orientation/orientation_editor.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/orientation/orientation_editor.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js similarity index 90% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js index b28743f426262..6c953274b1b4d 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { ValidatedRange } from '../../../../../components/validated_range'; +import { ValidatedRange } from '../../../../../../../../legacy/plugins/maps/public/components/validated_range'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; export function StaticOrientationForm({ onStaticStyleChange, staticDynamicSelect, styleProperty }) { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/size/dynamic_size_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/size/dynamic_size_form.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/size/dynamic_size_form.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/size/dynamic_size_form.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/size/size_range_selector.js b/x-pack/plugins/maps/public/layers/styles/vector/components/size/size_range_selector.js similarity index 92% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/size/size_range_selector.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/size/size_range_selector.js index 5de7b462136e1..ec847e2a5384e 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/size/size_range_selector.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/size/size_range_selector.js @@ -6,7 +6,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { ValidatedDualRange } from '../../../../../../../../../../src/plugins/kibana_react/public'; +import { ValidatedDualRange } from '../../../../../../../../../src/plugins/kibana_react/public'; import { MIN_SIZE, MAX_SIZE } from '../../vector_style_defaults'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js index 90e540cc6802a..1192b36cea029 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { ValidatedRange } from '../../../../../components/validated_range'; +import { ValidatedRange } from '../../../../../../../../legacy/plugins/maps/public/components/validated_range'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/size/vector_style_size_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/size/vector_style_size_editor.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/size/vector_style_size_editor.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/size/vector_style_size_editor.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/stop_input.js b/x-pack/plugins/maps/public/layers/styles/vector/components/stop_input.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/stop_input.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/stop_input.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/style_map_select.js b/x-pack/plugins/maps/public/layers/styles/vector/components/style_map_select.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/style_map_select.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/style_map_select.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/style_option_shapes.js b/x-pack/plugins/maps/public/layers/styles/vector/components/style_option_shapes.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/style_option_shapes.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/style_option_shapes.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js similarity index 97% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js index 005bc11aa1bd8..5215390edb382 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js @@ -14,7 +14,7 @@ import { EuiFieldText, EuiToolTip, } from '@elastic/eui'; -import { STYLE_TYPE } from '../../../../../common/constants'; +import { STYLE_TYPE } from '../../../../../../../legacy/plugins/maps/common/constants'; import { i18n } from '@kbn/i18n'; export class StylePropEditor extends Component { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/__snapshots__/icon_select.test.js.snap b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/__snapshots__/icon_select.test.js.snap similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/__snapshots__/icon_select.test.js.snap rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/__snapshots__/icon_select.test.js.snap diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/_icon_select.scss b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/_icon_select.scss similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/_icon_select.scss rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/_icon_select.scss diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/dynamic_icon_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/dynamic_icon_form.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/dynamic_icon_form.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/dynamic_icon_form.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_map_select.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_map_select.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_map_select.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_map_select.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_select.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_select.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_select.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_select.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_select.test.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_select.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_select.test.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_select.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js similarity index 98% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js index 0da3074f55e49..41da29e6bb3f8 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { DEFAULT_ICON } from '../../../../../../common/constants'; +import { DEFAULT_ICON } from '../../../../../../../../legacy/plugins/maps/common/constants'; import { i18n } from '@kbn/i18n'; import { getOtherCategoryLabel } from '../../style_util'; import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiFieldText } from '@elastic/eui'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.test.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.test.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/static_icon_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/static_icon_form.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/static_icon_form.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/static_icon_form.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js similarity index 90% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js index 36b6c1a76470c..190fc05b9ddcc 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js @@ -6,7 +6,7 @@ import React from 'react'; -import { getUiSettings } from '../../../../../kibana_services'; +import { getUiSettings } from '../../../../../../../../legacy/plugins/maps/public/kibana_services'; import { StylePropEditor } from '../style_prop_editor'; import { DynamicIconForm } from './dynamic_icon_form'; import { StaticIconForm } from './static_icon_form'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js similarity index 94% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js index cf287e8b1fd5f..ef1e668a3802f 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js @@ -9,7 +9,10 @@ import React from 'react'; import { EuiFormRow, EuiButtonGroup, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { SYMBOLIZE_AS_TYPES, VECTOR_STYLES } from '../../../../../../common/constants'; +import { + SYMBOLIZE_AS_TYPES, + VECTOR_STYLES, +} from '../../../../../../../../legacy/plugins/maps/common/constants'; import { getDisabledByMessage } from '../get_vector_style_label'; const SYMBOLIZE_AS_OPTIONS = [ diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js similarity index 99% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js rename to x-pack/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js index 6cece5efb3a5d..e6b845b9d6cf6 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js @@ -26,7 +26,7 @@ import { LABEL_BORDER_SIZES, VECTOR_STYLES, STYLE_TYPE, -} from '../../../../../common/constants'; +} from '../../../../../../../legacy/plugins/maps/common/constants'; export class VectorStyleEditor extends Component { state = { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/__snapshots__/dynamic_color_property.test.js.snap b/x-pack/plugins/maps/public/layers/styles/vector/properties/__snapshots__/dynamic_color_property.test.js.snap similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/__snapshots__/dynamic_color_property.test.js.snap rename to x-pack/plugins/maps/public/layers/styles/vector/properties/__snapshots__/dynamic_color_property.test.js.snap diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/components/categorical_legend.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/components/categorical_legend.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/components/categorical_legend.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/components/categorical_legend.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/components/ordinal_legend.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/components/ordinal_legend.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/components/ordinal_legend.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/components/ordinal_legend.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js similarity index 99% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js index 146bc40aa8531..0c4d4218d57bd 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js @@ -18,7 +18,7 @@ import { EuiTextColor, } from '@elastic/eui'; import { Category } from '../components/legend/category'; -import { COLOR_MAP_TYPE } from '../../../../../common/constants'; +import { COLOR_MAP_TYPE } from '../../../../../../../legacy/plugins/maps/common/constants'; import { isCategoricalStopsInvalid } from '../components/color/color_stops_utils'; const EMPTY_STOPS = { stops: [], defaultColor: null }; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js similarity index 99% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js index b19c25b369848..8335b6382755c 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js @@ -16,7 +16,11 @@ import { shallow } from 'enzyme'; import { DynamicColorProperty } from './dynamic_color_property'; import { StyleMeta } from '../style_meta'; -import { COLOR_MAP_TYPE, FIELD_ORIGIN, VECTOR_STYLES } from '../../../../../common/constants'; +import { + COLOR_MAP_TYPE, + FIELD_ORIGIN, + VECTOR_STYLES, +} from '../../../../../../../legacy/plugins/maps/common/constants'; const mockField = { async getLabel() { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_icon_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_icon_property.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_icon_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_icon_property.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js index ae4d935e2457b..441d5ddb8ceea 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js @@ -6,7 +6,7 @@ import { DynamicStyleProperty } from './dynamic_style_property'; import { getComputedFieldName } from '../style_util'; -import { VECTOR_STYLES } from '../../../../../common/constants'; +import { VECTOR_STYLES } from '../../../../../../../legacy/plugins/maps/common/constants'; export class DynamicOrientationProperty extends DynamicStyleProperty { syncIconRotationWithMb(symbolLayerId, mbMap) { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js similarity index 98% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js index 8b3f670bfa528..0b256e75eeadf 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js @@ -11,7 +11,7 @@ import { LARGE_MAKI_ICON_SIZE, SMALL_MAKI_ICON_SIZE, } from '../symbol_utils'; -import { VECTOR_STYLES } from '../../../../../common/constants'; +import { VECTOR_STYLES } from '../../../../../../../legacy/plugins/maps/common/constants'; import _ from 'lodash'; import { CircleIcon } from '../components/legend/circle_icon'; import React, { Fragment } from 'react'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts similarity index 89% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts rename to x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts index 88eb489c4996e..6fd15eaaeda97 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts @@ -6,13 +6,13 @@ /* eslint-disable @typescript-eslint/consistent-type-definitions */ import { IStyleProperty } from './style_property'; -import { FIELD_ORIGIN } from '../../../../../common/constants'; +import { FIELD_ORIGIN } from '../../../../../../../legacy/plugins/maps/common/constants'; import { CategoryFieldMeta, DynamicStylePropertyOptions, FieldMetaOptions, RangeFieldMeta, -} from '../../../../../common/descriptor_types'; +} from '../../../../../../../legacy/plugins/maps/common/descriptor_types'; import { IField } from '../../../fields/field'; export interface IDynamicStyleProperty extends IStyleProperty { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js similarity index 99% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js index ea521f8749d80..86fe89b0aae10 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js @@ -12,7 +12,7 @@ import { STYLE_TYPE, SOURCE_META_ID_ORIGIN, FIELD_ORIGIN, -} from '../../../../../common/constants'; +} from '../../../../../../../legacy/plugins/maps/common/constants'; import React from 'react'; import { OrdinalLegend } from './components/ordinal_legend'; import { CategoricalLegend } from './components/categorical_legend'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_text_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_text_property.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_text_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_text_property.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js similarity index 95% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js index 3016b15d0a05c..bb0ce494be170 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js @@ -7,7 +7,7 @@ import _ from 'lodash'; import { AbstractStyleProperty } from './style_property'; import { DEFAULT_LABEL_SIZE } from '../vector_style_defaults'; -import { LABEL_BORDER_SIZES } from '../../../../../common/constants'; +import { LABEL_BORDER_SIZES } from '../../../../../../../legacy/plugins/maps/common/constants'; const SMALL_SIZE = 1 / 16; const MEDIUM_SIZE = 1 / 8; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_color_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/static_color_property.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_color_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/static_color_property.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_icon_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/static_icon_property.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_icon_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/static_icon_property.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_orientation_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/static_orientation_property.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_orientation_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/static_orientation_property.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_size_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/static_size_property.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_size_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/static_size_property.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_style_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/static_style_property.js similarity index 82% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_style_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/static_style_property.js index a02aa15e28b28..636c38ecb2667 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_style_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/static_style_property.js @@ -5,7 +5,7 @@ */ import { AbstractStyleProperty } from './style_property'; -import { STYLE_TYPE } from '../../../../../common/constants'; +import { STYLE_TYPE } from '../../../../../../../legacy/plugins/maps/common/constants'; export class StaticStyleProperty extends AbstractStyleProperty { static type = STYLE_TYPE.STATIC; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_text_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/static_text_property.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/static_text_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/static_text_property.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/style_property.ts b/x-pack/plugins/maps/public/layers/styles/vector/properties/style_property.ts similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/style_property.ts rename to x-pack/plugins/maps/public/layers/styles/vector/properties/style_property.ts index af04a95e3c3bd..2d22c891afaa1 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/style_property.ts +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/style_property.ts @@ -8,8 +8,11 @@ import { ReactElement } from 'react'; // @ts-ignore import { getVectorStyleLabel } from '../components/get_vector_style_label'; -import { FieldMetaOptions, StylePropertyOptions } from '../../../../../common/descriptor_types'; -import { VECTOR_STYLES } from '../../../../../common/constants'; +import { + FieldMetaOptions, + StylePropertyOptions, +} from '../../../../../../../legacy/plugins/maps/common/descriptor_types'; +import { VECTOR_STYLES } from '../../../../../../../legacy/plugins/maps/common/constants'; type LegendProps = { isPointsOnly: boolean; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js similarity index 84% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js rename to x-pack/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js index 9ae1ef5054e30..9f24d81a9b6e1 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js @@ -5,7 +5,7 @@ */ import { AbstractStyleProperty } from './style_property'; -import { SYMBOLIZE_AS_TYPES } from '../../../../../common/constants'; +import { SYMBOLIZE_AS_TYPES } from '../../../../../../../legacy/plugins/maps/common/constants'; export class SymbolizeAsProperty extends AbstractStyleProperty { constructor(options, styleName) { diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/style_meta.ts b/x-pack/plugins/maps/public/layers/styles/vector/style_meta.ts similarity index 95% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/style_meta.ts rename to x-pack/plugins/maps/public/layers/styles/vector/style_meta.ts index 646b88d005af7..d130a9752b674 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/style_meta.ts +++ b/x-pack/plugins/maps/public/layers/styles/vector/style_meta.ts @@ -8,7 +8,7 @@ import { StyleMetaDescriptor, RangeFieldMeta, CategoryFieldMeta, -} from '../../../../common/descriptor_types'; +} from '../../../../../../legacy/plugins/maps/common/descriptor_types'; export class StyleMeta { private readonly _descriptor: StyleMetaDescriptor; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/style_util.js b/x-pack/plugins/maps/public/layers/styles/vector/style_util.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/style_util.js rename to x-pack/plugins/maps/public/layers/styles/vector/style_util.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/style_util.test.js b/x-pack/plugins/maps/public/layers/styles/vector/style_util.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/style_util.test.js rename to x-pack/plugins/maps/public/layers/styles/vector/style_util.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/symbol_utils.js b/x-pack/plugins/maps/public/layers/styles/vector/symbol_utils.js similarity index 97% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/symbol_utils.js rename to x-pack/plugins/maps/public/layers/styles/vector/symbol_utils.js index c1c4375faaeb1..d98673d63fc1e 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/symbol_utils.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/symbol_utils.js @@ -7,7 +7,7 @@ import React from 'react'; import maki from '@elastic/maki'; import xml2js from 'xml2js'; -import { parseXmlString } from '../../../../common/parse_xml_string'; +import { parseXmlString } from '../../../../../../legacy/plugins/maps/common/parse_xml_string'; import { SymbolIcon } from './components/legend/symbol_icon'; export const LARGE_MAKI_ICON_SIZE = 15; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/symbol_utils.test.js b/x-pack/plugins/maps/public/layers/styles/vector/symbol_utils.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/symbol_utils.test.js rename to x-pack/plugins/maps/public/layers/styles/vector/symbol_utils.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.d.ts b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.d.ts similarity index 90% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.d.ts rename to x-pack/plugins/maps/public/layers/styles/vector/vector_style.d.ts index 77ea44ac26bf9..6ed1c24cc5d09 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.d.ts +++ b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.d.ts @@ -7,7 +7,7 @@ import { IStyleProperty } from './properties/style_property'; import { IDynamicStyleProperty } from './properties/dynamic_style_property'; import { IVectorLayer } from '../../vector_layer'; import { IVectorSource } from '../../sources/vector_source'; -import { VectorStyleDescriptor } from '../../../../common/descriptor_types'; +import { VectorStyleDescriptor } from '../../../../../../legacy/plugins/maps/common/descriptor_types'; export interface IVectorStyle { getAllStyleProperties(): IStyleProperty[]; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.js b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.js similarity index 99% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.js rename to x-pack/plugins/maps/public/layers/styles/vector/vector_style.js index ae5d148e43cfd..db1a6341014f6 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.js @@ -17,7 +17,7 @@ import { LAYER_STYLE_TYPE, DEFAULT_ICON, VECTOR_STYLES, -} from '../../../../common/constants'; +} from '../../../../../../legacy/plugins/maps/common/constants'; import { StyleMeta } from './style_meta'; import { VectorIcon } from './components/legend/vector_icon'; import { VectorStyleLegend } from './components/legend/vector_style_legend'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.test.js b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.test.js similarity index 97% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.test.js rename to x-pack/plugins/maps/public/layers/styles/vector/vector_style.test.js index 426f1d6afa952..b5e16223fc2ee 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style.test.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.test.js @@ -7,7 +7,7 @@ import { VectorStyle } from './vector_style'; import { DataRequest } from '../../util/data_request'; import { VECTOR_SHAPE_TYPES } from '../../sources/vector_feature_types'; -import { FIELD_ORIGIN, STYLE_TYPE } from '../../../../common/constants'; +import { FIELD_ORIGIN, STYLE_TYPE } from '../../../../../../legacy/plugins/maps/common/constants'; jest.mock('../../../kibana_services'); jest.mock('ui/new_platform'); @@ -67,7 +67,7 @@ describe('getDescriptorWithMissingStylePropsRemoved', () => { }; beforeEach(() => { - require('../../../kibana_services').getUiSettings = () => ({ + require('../../../../../../legacy/plugins/maps/public/kibana_services').getUiSettings = () => ({ get: jest.fn(), }); }); diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts b/x-pack/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts similarity index 95% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts rename to x-pack/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts index 86602381cf615..cf10af8470afe 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts +++ b/x-pack/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts @@ -10,7 +10,7 @@ import { SYMBOLIZE_AS_TYPES, VECTOR_STYLES, STYLE_TYPE, -} from '../../../../common/constants'; +} from '../../../../../../legacy/plugins/maps/common/constants'; import { COLOR_GRADIENTS, COLOR_PALETTES, @@ -18,9 +18,9 @@ import { DEFAULT_LINE_COLORS, // @ts-ignore } from '../color_utils'; -import { VectorStylePropertiesDescriptor } from '../../../../common/descriptor_types'; +import { VectorStylePropertiesDescriptor } from '../../../../../../legacy/plugins/maps/common/descriptor_types'; // @ts-ignore -import { getUiSettings } from '../../../kibana_services'; +import { getUiSettings } from '../../../../../../legacy/plugins/maps/public/kibana_services'; export const MIN_SIZE = 1; export const MAX_SIZE = 64; diff --git a/x-pack/legacy/plugins/maps/public/layers/tile_layer.d.ts b/x-pack/plugins/maps/public/layers/tile_layer.d.ts similarity index 86% rename from x-pack/legacy/plugins/maps/public/layers/tile_layer.d.ts rename to x-pack/plugins/maps/public/layers/tile_layer.d.ts index 53e8c388ee4c2..a36f7a53cc905 100644 --- a/x-pack/legacy/plugins/maps/public/layers/tile_layer.d.ts +++ b/x-pack/plugins/maps/public/layers/tile_layer.d.ts @@ -6,7 +6,7 @@ import { AbstractLayer, ILayerArguments } from './layer'; import { ITMSSource } from './sources/tms_source'; -import { LayerDescriptor } from '../../common/descriptor_types'; +import { LayerDescriptor } from '../../../../legacy/plugins/maps/common/descriptor_types'; interface ITileLayerArguments extends ILayerArguments { source: ITMSSource; diff --git a/x-pack/legacy/plugins/maps/public/layers/tile_layer.js b/x-pack/plugins/maps/public/layers/tile_layer.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/tile_layer.js rename to x-pack/plugins/maps/public/layers/tile_layer.js index aa2619e96f834..bd27f60125927 100644 --- a/x-pack/legacy/plugins/maps/public/layers/tile_layer.js +++ b/x-pack/plugins/maps/public/layers/tile_layer.js @@ -6,7 +6,10 @@ import { AbstractLayer } from './layer'; import _ from 'lodash'; -import { SOURCE_DATA_ID_ORIGIN, LAYER_TYPE } from '../../common/constants'; +import { + SOURCE_DATA_ID_ORIGIN, + LAYER_TYPE, +} from '../../../../legacy/plugins/maps/common/constants'; export class TileLayer extends AbstractLayer { static type = LAYER_TYPE.TILE; diff --git a/x-pack/legacy/plugins/maps/public/layers/tile_layer.test.ts b/x-pack/plugins/maps/public/layers/tile_layer.test.ts similarity index 90% rename from x-pack/legacy/plugins/maps/public/layers/tile_layer.test.ts rename to x-pack/plugins/maps/public/layers/tile_layer.test.ts index 1cb99dcbc1a70..a5087041b826c 100644 --- a/x-pack/legacy/plugins/maps/public/layers/tile_layer.test.ts +++ b/x-pack/plugins/maps/public/layers/tile_layer.test.ts @@ -5,8 +5,8 @@ */ import { TileLayer } from './tile_layer'; -import { EMS_XYZ } from '../../common/constants'; -import { XYZTMSSourceDescriptor } from '../../common/descriptor_types'; +import { EMS_XYZ } from '../../../../legacy/plugins/maps/common/constants'; +import { XYZTMSSourceDescriptor } from '../../../../legacy/plugins/maps/common/descriptor_types'; import { ITMSSource, AbstractTMSSource } from './sources/tms_source'; import { ILayer } from './layer'; diff --git a/x-pack/legacy/plugins/maps/public/layers/tooltips/es_agg_tooltip_property.ts b/x-pack/plugins/maps/public/layers/tooltips/es_agg_tooltip_property.ts similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/tooltips/es_agg_tooltip_property.ts rename to x-pack/plugins/maps/public/layers/tooltips/es_agg_tooltip_property.ts diff --git a/x-pack/legacy/plugins/maps/public/layers/tooltips/es_tooltip_property.ts b/x-pack/plugins/maps/public/layers/tooltips/es_tooltip_property.ts similarity index 95% rename from x-pack/legacy/plugins/maps/public/layers/tooltips/es_tooltip_property.ts rename to x-pack/plugins/maps/public/layers/tooltips/es_tooltip_property.ts index 8fd7e173435ce..5c35009881920 100644 --- a/x-pack/legacy/plugins/maps/public/layers/tooltips/es_tooltip_property.ts +++ b/x-pack/plugins/maps/public/layers/tooltips/es_tooltip_property.ts @@ -7,8 +7,8 @@ import _ from 'lodash'; import { ITooltipProperty } from './tooltip_property'; import { IField } from '../fields/field'; -import { esFilters, IFieldType, IndexPattern } from '../../../../../../../src/plugins/data/public'; -import { PhraseFilter } from '../../../../../../../src/plugins/data/public'; +import { esFilters, IFieldType, IndexPattern } from '../../../../../../src/plugins/data/public'; +import { PhraseFilter } from '../../../../../../src/plugins/data/public'; export class ESTooltipProperty implements ITooltipProperty { private readonly _tooltipProperty: ITooltipProperty; diff --git a/x-pack/legacy/plugins/maps/public/layers/tooltips/join_tooltip_property.ts b/x-pack/plugins/maps/public/layers/tooltips/join_tooltip_property.ts similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/tooltips/join_tooltip_property.ts rename to x-pack/plugins/maps/public/layers/tooltips/join_tooltip_property.ts index 02f0920ce3c61..4af236f6e9e36 100644 --- a/x-pack/legacy/plugins/maps/public/layers/tooltips/join_tooltip_property.ts +++ b/x-pack/plugins/maps/public/layers/tooltips/join_tooltip_property.ts @@ -6,7 +6,7 @@ import { ITooltipProperty } from './tooltip_property'; import { IJoin } from '../joins/join'; -import { PhraseFilter } from '../../../../../../../src/plugins/data/public'; +import { PhraseFilter } from '../../../../../../src/plugins/data/public'; export class JoinTooltipProperty implements ITooltipProperty { private readonly _tooltipProperty: ITooltipProperty; diff --git a/x-pack/legacy/plugins/maps/public/layers/tooltips/tooltip_property.ts b/x-pack/plugins/maps/public/layers/tooltips/tooltip_property.ts similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/tooltips/tooltip_property.ts rename to x-pack/plugins/maps/public/layers/tooltips/tooltip_property.ts index c77af11d0ae24..76515754912db 100644 --- a/x-pack/legacy/plugins/maps/public/layers/tooltips/tooltip_property.ts +++ b/x-pack/plugins/maps/public/layers/tooltips/tooltip_property.ts @@ -5,7 +5,7 @@ */ import _ from 'lodash'; -import { PhraseFilter } from '../../../../../../../src/plugins/data/public'; +import { PhraseFilter } from '../../../../../../src/plugins/data/public'; export interface ITooltipProperty { getPropertyKey(): string; diff --git a/x-pack/legacy/plugins/maps/public/layers/util/assign_feature_ids.test.ts b/x-pack/plugins/maps/public/layers/util/assign_feature_ids.test.ts similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/util/assign_feature_ids.test.ts rename to x-pack/plugins/maps/public/layers/util/assign_feature_ids.test.ts index fb07a523e1e07..7d6dbb5c8a2fe 100644 --- a/x-pack/legacy/plugins/maps/public/layers/util/assign_feature_ids.test.ts +++ b/x-pack/plugins/maps/public/layers/util/assign_feature_ids.test.ts @@ -5,7 +5,7 @@ */ import { assignFeatureIds } from './assign_feature_ids'; -import { FEATURE_ID_PROPERTY_NAME } from '../../../common/constants'; +import { FEATURE_ID_PROPERTY_NAME } from '../../../../../legacy/plugins/maps/common/constants'; import { FeatureCollection, Feature, Point } from 'geojson'; const featureId = 'myFeature1'; diff --git a/x-pack/legacy/plugins/maps/public/layers/util/assign_feature_ids.ts b/x-pack/plugins/maps/public/layers/util/assign_feature_ids.ts similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/util/assign_feature_ids.ts rename to x-pack/plugins/maps/public/layers/util/assign_feature_ids.ts index e5c170a803174..aeb04f546bdf1 100644 --- a/x-pack/legacy/plugins/maps/public/layers/util/assign_feature_ids.ts +++ b/x-pack/plugins/maps/public/layers/util/assign_feature_ids.ts @@ -6,7 +6,7 @@ import _ from 'lodash'; import { FeatureCollection, Feature } from 'geojson'; -import { FEATURE_ID_PROPERTY_NAME } from '../../../common/constants'; +import { FEATURE_ID_PROPERTY_NAME } from '../../../../../legacy/plugins/maps/common/constants'; let idCounter = 0; diff --git a/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.test.js b/x-pack/plugins/maps/public/layers/util/can_skip_fetch.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.test.js rename to x-pack/plugins/maps/public/layers/util/can_skip_fetch.test.js diff --git a/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.ts b/x-pack/plugins/maps/public/layers/util/can_skip_fetch.ts similarity index 98% rename from x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.ts rename to x-pack/plugins/maps/public/layers/util/can_skip_fetch.ts index 758cc35f41fbb..4b13c48f5b699 100644 --- a/x-pack/legacy/plugins/maps/public/layers/util/can_skip_fetch.ts +++ b/x-pack/plugins/maps/public/layers/util/can_skip_fetch.ts @@ -9,7 +9,7 @@ import turf from 'turf'; import turfBooleanContains from '@turf/boolean-contains'; import { isRefreshOnlyQuery } from './is_refresh_only_query'; import { ISource } from '../sources/source'; -import { DataMeta } from '../../../common/descriptor_types'; +import { DataMeta } from '../../../../../legacy/plugins/maps/common/descriptor_types'; import { DataRequest } from './data_request'; const SOURCE_UPDATE_REQUIRED = true; diff --git a/x-pack/legacy/plugins/maps/public/layers/util/data_request.ts b/x-pack/plugins/maps/public/layers/util/data_request.ts similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/util/data_request.ts rename to x-pack/plugins/maps/public/layers/util/data_request.ts index eeef5c49c6ef8..fe505b6596d87 100644 --- a/x-pack/legacy/plugins/maps/public/layers/util/data_request.ts +++ b/x-pack/plugins/maps/public/layers/util/data_request.ts @@ -6,7 +6,10 @@ /* eslint-disable max-classes-per-file */ import _ from 'lodash'; -import { DataRequestDescriptor, DataMeta } from '../../../common/descriptor_types'; +import { + DataRequestDescriptor, + DataMeta, +} from '../../../../../legacy/plugins/maps/common/descriptor_types'; export class DataRequest { private readonly _descriptor: DataRequestDescriptor; diff --git a/x-pack/legacy/plugins/maps/public/layers/util/es_agg_utils.test.ts b/x-pack/plugins/maps/public/layers/util/es_agg_utils.test.ts similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/util/es_agg_utils.test.ts rename to x-pack/plugins/maps/public/layers/util/es_agg_utils.test.ts diff --git a/x-pack/legacy/plugins/maps/public/layers/util/es_agg_utils.ts b/x-pack/plugins/maps/public/layers/util/es_agg_utils.ts similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/util/es_agg_utils.ts rename to x-pack/plugins/maps/public/layers/util/es_agg_utils.ts index 9d4f24f80d6cd..878da180822ee 100644 --- a/x-pack/legacy/plugins/maps/public/layers/util/es_agg_utils.ts +++ b/x-pack/plugins/maps/public/layers/util/es_agg_utils.ts @@ -5,8 +5,8 @@ */ import { i18n } from '@kbn/i18n'; import _ from 'lodash'; -import { IndexPattern, IFieldType } from '../../../../../../../src/plugins/data/public'; -import { TOP_TERM_PERCENTAGE_SUFFIX } from '../../../common/constants'; +import { IndexPattern, IFieldType } from '../../../../../../src/plugins/data/public'; +import { TOP_TERM_PERCENTAGE_SUFFIX } from '../../../../../legacy/plugins/maps/common/constants'; export function getField(indexPattern: IndexPattern, fieldName: string) { const field = indexPattern.fields.getByName(fieldName); diff --git a/x-pack/legacy/plugins/maps/public/layers/util/is_metric_countable.ts b/x-pack/plugins/maps/public/layers/util/is_metric_countable.ts similarity index 83% rename from x-pack/legacy/plugins/maps/public/layers/util/is_metric_countable.ts rename to x-pack/plugins/maps/public/layers/util/is_metric_countable.ts index 37916e53d6c45..505d57e47007e 100644 --- a/x-pack/legacy/plugins/maps/public/layers/util/is_metric_countable.ts +++ b/x-pack/plugins/maps/public/layers/util/is_metric_countable.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AGG_TYPE } from '../../../common/constants'; +import { AGG_TYPE } from '../../../../../legacy/plugins/maps/common/constants'; export function isMetricCountable(aggType: AGG_TYPE): boolean { return [AGG_TYPE.COUNT, AGG_TYPE.SUM, AGG_TYPE.UNIQUE_COUNT].includes(aggType); diff --git a/x-pack/legacy/plugins/maps/public/layers/util/is_refresh_only_query.ts b/x-pack/plugins/maps/public/layers/util/is_refresh_only_query.ts similarity index 89% rename from x-pack/legacy/plugins/maps/public/layers/util/is_refresh_only_query.ts rename to x-pack/plugins/maps/public/layers/util/is_refresh_only_query.ts index a56da4b23aa1e..f8bcf61b28393 100644 --- a/x-pack/legacy/plugins/maps/public/layers/util/is_refresh_only_query.ts +++ b/x-pack/plugins/maps/public/layers/util/is_refresh_only_query.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Query } from '../../../common/descriptor_types'; +import { Query } from '../../../../../legacy/plugins/maps/common/descriptor_types'; // Refresh only query is query where timestamps are different but query is the same. // Triggered by clicking "Refresh" button in QueryBar diff --git a/x-pack/legacy/plugins/maps/public/layers/util/mb_filter_expressions.ts b/x-pack/plugins/maps/public/layers/util/mb_filter_expressions.ts similarity index 93% rename from x-pack/legacy/plugins/maps/public/layers/util/mb_filter_expressions.ts rename to x-pack/plugins/maps/public/layers/util/mb_filter_expressions.ts index 8da6fa2318de9..cf315d82d8b87 100644 --- a/x-pack/legacy/plugins/maps/public/layers/util/mb_filter_expressions.ts +++ b/x-pack/plugins/maps/public/layers/util/mb_filter_expressions.ts @@ -4,7 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { GEO_JSON_TYPE, FEATURE_VISIBLE_PROPERTY_NAME } from '../../../common/constants'; +import { + GEO_JSON_TYPE, + FEATURE_VISIBLE_PROPERTY_NAME, +} from '../../../../../legacy/plugins/maps/common/constants'; const VISIBILITY_FILTER_CLAUSE = ['all', ['==', ['get', FEATURE_VISIBLE_PROPERTY_NAME], true]]; diff --git a/x-pack/legacy/plugins/maps/public/layers/vector_layer.d.ts b/x-pack/plugins/maps/public/layers/vector_layer.d.ts similarity index 91% rename from x-pack/legacy/plugins/maps/public/layers/vector_layer.d.ts rename to x-pack/plugins/maps/public/layers/vector_layer.d.ts index 70fd9927b7732..ae26d48d69f38 100644 --- a/x-pack/legacy/plugins/maps/public/layers/vector_layer.d.ts +++ b/x-pack/plugins/maps/public/layers/vector_layer.d.ts @@ -11,12 +11,12 @@ import { MapFilters, VectorLayerDescriptor, VectorSourceRequestMeta, -} from '../../common/descriptor_types'; +} from '../../../../legacy/plugins/maps/common/descriptor_types'; import { ILayer } from './layer'; import { IJoin } from './joins/join'; import { IVectorStyle } from './styles/vector/vector_style'; import { IField } from './fields/field'; -import { SyncContext } from '../actions/map_actions'; +import { SyncContext } from '../../../../legacy/plugins/maps/public/actions/map_actions'; type VectorLayerArguments = { source: IVectorSource; diff --git a/x-pack/legacy/plugins/maps/public/layers/vector_layer.js b/x-pack/plugins/maps/public/layers/vector_layer.js similarity index 99% rename from x-pack/legacy/plugins/maps/public/layers/vector_layer.js rename to x-pack/plugins/maps/public/layers/vector_layer.js index 6b89554546330..8deaca1c331f4 100644 --- a/x-pack/legacy/plugins/maps/public/layers/vector_layer.js +++ b/x-pack/plugins/maps/public/layers/vector_layer.js @@ -18,7 +18,7 @@ import { LAYER_TYPE, FIELD_ORIGIN, LAYER_STYLE_TYPE, -} from '../../common/constants'; +} from '../../../../legacy/plugins/maps/common/constants'; import _ from 'lodash'; import { JoinTooltipProperty } from './tooltips/join_tooltip_property'; import { EuiIcon } from '@elastic/eui'; diff --git a/x-pack/legacy/plugins/maps/public/layers/vector_tile_layer.js b/x-pack/plugins/maps/public/layers/vector_tile_layer.js similarity index 96% rename from x-pack/legacy/plugins/maps/public/layers/vector_tile_layer.js rename to x-pack/plugins/maps/public/layers/vector_tile_layer.js index 44987fd3e78f0..d4f224e66c51d 100644 --- a/x-pack/legacy/plugins/maps/public/layers/vector_tile_layer.js +++ b/x-pack/plugins/maps/public/layers/vector_tile_layer.js @@ -6,12 +6,15 @@ import { TileLayer } from './tile_layer'; import _ from 'lodash'; -import { SOURCE_DATA_ID_ORIGIN, LAYER_TYPE } from '../../common/constants'; -import { isRetina } from '../meta'; +import { + SOURCE_DATA_ID_ORIGIN, + LAYER_TYPE, +} from '../../../../legacy/plugins/maps/common/constants'; +import { isRetina } from '../../../../legacy/plugins/maps/public/meta'; import { addSpriteSheetToMapFromImageData, loadSpriteSheetImageData, -} from '../connected_components/map/mb/utils'; //todo move this implementation +} from '../../../../legacy/plugins/maps/public/connected_components/map/mb/utils'; //todo move this implementation const MB_STYLE_TYPE_TO_OPACITY = { fill: ['fill-opacity'], From 8168eabf91fa9152c7b9934aebe27162fba27e02 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Mon, 30 Mar 2020 12:14:01 -0600 Subject: [PATCH 02/14] Update layer path refs --- .../maps/public/angular/get_initial_layers.js | 6 ++++-- .../connected_components/gis_map/index.d.ts | 3 ++- .../layer_addpanel/import_editor/view.js | 3 ++- .../layer_addpanel/source_editor/view.js | 3 ++- .../source_select/source_select.js | 3 ++- .../maps/public/embeddable/map_embeddable.tsx | 3 ++- .../embeddable/map_embeddable_factory.ts | 3 ++- x-pack/legacy/plugins/maps/public/index.scss | 2 +- x-pack/legacy/plugins/maps/public/index.ts | 6 +++++- .../maps/public/selectors/map_selectors.js | 21 ++++++++++++------- .../sources/es_search_source/scaling_form.tsx | 2 +- 11 files changed, 37 insertions(+), 18 deletions(-) diff --git a/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.js b/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.js index 8fc32aef54770..799b077d6d89c 100644 --- a/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.js +++ b/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.js @@ -4,8 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ import _ from 'lodash'; -import { KibanaTilemapSource } from '../layers/sources/kibana_tilemap_source'; -import { EMSTMSSource } from '../layers/sources/ems_tms_source'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { KibanaTilemapSource } from '../../../../../plugins/maps/public/layers/sources/kibana_tilemap_source'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { EMSTMSSource } from '../../../../../plugins/maps/public/layers/sources/ems_tms_source'; import { getInjectedVarFunc } from '../kibana_services'; import { getKibanaTileMap } from '../meta'; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/gis_map/index.d.ts b/x-pack/legacy/plugins/maps/public/connected_components/gis_map/index.d.ts index 00a9400109dc1..8689d88297171 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/gis_map/index.d.ts +++ b/x-pack/legacy/plugins/maps/public/connected_components/gis_map/index.d.ts @@ -6,7 +6,8 @@ import React from 'react'; import { Filter } from 'src/plugins/data/public'; -import { RenderToolTipContent } from '../../layers/tooltips/tooltip_property'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { RenderToolTipContent } from '../../../../../../plugins/maps/public/layers/tooltips/tooltip_property'; export const GisMap: React.ComponentType<{ addFilters: ((filters: Filter[]) => void) | null; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/import_editor/view.js b/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/import_editor/view.js index e9ef38e17b188..47ee0f3118955 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/import_editor/view.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/import_editor/view.js @@ -5,7 +5,8 @@ */ import React, { Fragment } from 'react'; -import { GeojsonFileSource } from '../../../layers/sources/client_file_source'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { GeojsonFileSource } from '../../../../../../../plugins/maps/public/layers/sources/client_file_source'; import { EuiSpacer, EuiPanel, EuiButtonEmpty } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_editor/view.js b/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_editor/view.js index 45c508e0d5889..1fc0302a49640 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_editor/view.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_editor/view.js @@ -5,7 +5,8 @@ */ import React, { Fragment } from 'react'; -import { ALL_SOURCES } from '../../../layers/sources/all_sources'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { ALL_SOURCES } from '../../../../../../../plugins/maps/public/layers/sources/all_sources'; import { EuiSpacer, EuiPanel, EuiButtonEmpty } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_select/source_select.js b/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_select/source_select.js index 574a57b1041a0..6a304784df18f 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_select/source_select.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_select/source_select.js @@ -5,7 +5,8 @@ */ import React, { Fragment } from 'react'; -import { ALL_SOURCES } from '../../../layers/sources/all_sources'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { ALL_SOURCES } from '../../../../../../../plugins/maps/public/layers/sources/all_sources'; import { EuiTitle, EuiSpacer, EuiCard, EuiIcon } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import _ from 'lodash'; diff --git a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.tsx b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.tsx index 69f55815d16a0..6782a01ca10ce 100644 --- a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.tsx +++ b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.tsx @@ -57,7 +57,8 @@ import { } from '../../../../../plugins/maps/public/reducers/non_serializable_instances'; import { getMapCenter, getMapZoom, getHiddenLayerIds } from '../selectors/map_selectors'; import { MAP_SAVED_OBJECT_TYPE } from '../../common/constants'; -import { RenderToolTipContent } from '../layers/tooltips/tooltip_property'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { RenderToolTipContent } from '../../../../../plugins/maps/public/layers/tooltips/tooltip_property'; interface MapEmbeddableConfig { editUrl?: string; diff --git a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.ts b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.ts index ddb937dd98926..d90024b070db9 100644 --- a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.ts +++ b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.ts @@ -29,7 +29,8 @@ import { getInitialLayers } from '../angular/get_initial_layers'; import { mergeInputWithSavedMap } from './merge_input_with_saved_map'; import '../angular/services/gis_map_saved_object_loader'; import { bindSetupCoreAndPlugins, bindStartCoreAndPlugins } from '../plugin'; -import { RenderToolTipContent } from '../layers/tooltips/tooltip_property'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { RenderToolTipContent } from '../../../../../plugins/maps/public/layers/tooltips/tooltip_property'; import { EventHandlers, // eslint-disable-next-line @kbn/eslint/no-restricted-paths diff --git a/x-pack/legacy/plugins/maps/public/index.scss b/x-pack/legacy/plugins/maps/public/index.scss index 328b2e576e0e6..b2ac514299d80 100644 --- a/x-pack/legacy/plugins/maps/public/index.scss +++ b/x-pack/legacy/plugins/maps/public/index.scss @@ -14,4 +14,4 @@ @import './mapbox_hacks'; @import './connected_components/index'; @import './components/index'; -@import './layers/index'; +@import '../../../../plugins/maps/public/layers/index'; diff --git a/x-pack/legacy/plugins/maps/public/index.ts b/x-pack/legacy/plugins/maps/public/index.ts index 2d13f005f1a70..b69485e251be4 100644 --- a/x-pack/legacy/plugins/maps/public/index.ts +++ b/x-pack/legacy/plugins/maps/public/index.ts @@ -26,5 +26,9 @@ export const plugin = (initializerContext: PluginInitializerContext) => { return new MapsPlugin(); }; -export { RenderTooltipContentParams, ITooltipProperty } from './layers/tooltips/tooltip_property'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +export { + RenderTooltipContentParams, + ITooltipProperty, +} from '../../../../plugins/maps/public/layers/tooltips/tooltip_property'; export { MapEmbeddable, MapEmbeddableInput } from './embeddable'; diff --git a/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js b/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js index 61eea2d172ae4..1316af9ec89c9 100644 --- a/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js +++ b/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js @@ -6,12 +6,18 @@ import { createSelector } from 'reselect'; import _ from 'lodash'; -import { TileLayer } from '../layers/tile_layer'; -import { VectorTileLayer } from '../layers/vector_tile_layer'; -import { VectorLayer } from '../layers/vector_layer'; -import { HeatmapLayer } from '../layers/heatmap_layer'; -import { BlendedVectorLayer } from '../layers/blended_vector_layer'; -import { ALL_SOURCES } from '../layers/sources/all_sources'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { TileLayer } from '../../../../../plugins/maps/public/layers/tile_layer'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { VectorTileLayer } from '../../../../../plugins/maps/public/layers/vector_tile_layer'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { VectorLayer } from '../../../../../plugins/maps/public/layers/vector_layer'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { HeatmapLayer } from '../../../../../plugins/maps/public/layers/heatmap_layer'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { BlendedVectorLayer } from '../../../../../plugins/maps/public/layers/blended_vector_layer'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { ALL_SOURCES } from '../../../../../plugins/maps/public/layers/sources/all_sources'; import { getTimeFilter } from '../kibana_services'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { getInspectorAdapters } from '../../../../../plugins/maps/public/reducers/non_serializable_instances'; @@ -20,7 +26,8 @@ import { TRACKED_LAYER_DESCRIPTOR, // eslint-disable-next-line @kbn/eslint/no-restricted-paths } from '../../../../../plugins/maps/public/reducers/util'; -import { InnerJoin } from '../layers/joins/inner_join'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { InnerJoin } from '../../../../../plugins/maps/public/layers/joins/inner_join'; function createLayerInstance(layerDescriptor, inspectorAdapters) { const source = createSourceInstance(layerDescriptor.sourceDescriptor, inspectorAdapters); diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx index fd7846a91fa22..ee8ecc27a0b54 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx @@ -21,10 +21,10 @@ import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/ // @ts-ignore import { indexPatternService } from '../../../../../../legacy/plugins/maps/public/kibana_services'; -// @ts-ignore import { getTermsFields, getSourceFields, + // @ts-ignore } from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; // @ts-ignore import { ValidatedRange } from '../../../../../../legacy/plugins/maps/public/components/validated_range'; From 423f4e3c82f3d65e71267da9d64d72d021f9899f Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Tue, 31 Mar 2020 17:16:07 -0600 Subject: [PATCH 03/14] Update np kibana services to cover all required services --- x-pack/plugins/maps/public/kibana_services.js | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/x-pack/plugins/maps/public/kibana_services.js b/x-pack/plugins/maps/public/kibana_services.js index 1073e44fa711e..d2ddecfdf915b 100644 --- a/x-pack/plugins/maps/public/kibana_services.js +++ b/x-pack/plugins/maps/public/kibana_services.js @@ -3,7 +3,89 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import { esFilters, search } from '../../../../src/plugins/data/public'; + +export { SearchSource } from '../../../../src/plugins/data/public'; + +export const SPATIAL_FILTER_TYPE = esFilters.FILTERS.SPATIAL_FILTER; +const { getRequestInspectorStats, getResponseInspectorStats } = search; + +let indexPatternService; +export const setIndexPatternService = dataIndexPatterns => + (indexPatternService = dataIndexPatterns); +export const getIndexPatternService = () => indexPatternService; + +let autocompleteService; +export const setAutocompleteService = dataAutoComplete => (autocompleteService = dataAutoComplete); +export const getAutocompleteService = () => autocompleteService; + +let licenseId; +export const setLicenseId = latestLicenseId => (licenseId = latestLicenseId); +export const getLicenseId = () => { + return licenseId; +}; + +let inspector; +export const setInspector = newInspector => (inspector = newInspector); +export const getInspector = () => { + return inspector; +}; + +let fileUploadPlugin; +export const setFileUpload = fileUpload => (fileUploadPlugin = fileUpload); +export const getFileUploadComponent = () => { + return fileUploadPlugin.JsonUploadAndParse; +}; let getInjectedVar; export const setInjectedVarFunc = getInjectedVarFunc => (getInjectedVar = getInjectedVarFunc); export const getInjectedVarFunc = () => getInjectedVar; + +let uiSettings; +export const setUiSettings = coreUiSettings => (uiSettings = coreUiSettings); +export const getUiSettings = () => uiSettings; + +let indexPatternSelectComponent; +export const setIndexPatternSelect = indexPatternSelect => + (indexPatternSelectComponent = indexPatternSelect); +export const getIndexPatternSelectComponent = () => indexPatternSelectComponent; + +let coreHttp; +export const setHttp = http => (coreHttp = http); +export const getHttp = () => coreHttp; + +let dataTimeFilter; +export const setTimeFilter = timeFilter => (dataTimeFilter = timeFilter); +export const getTimeFilter = () => dataTimeFilter; + +let toast; +export const setToasts = notificationToast => (toast = notificationToast); +export const getToasts = () => toast; + +export async function fetchSearchSourceAndRecordWithInspector({ + searchSource, + requestId, + requestName, + requestDesc, + inspectorAdapters, + abortSignal, +}) { + const inspectorRequest = inspectorAdapters.requests.start(requestName, { + id: requestId, + description: requestDesc, + }); + let resp; + try { + inspectorRequest.stats(getRequestInspectorStats(searchSource)); + searchSource.getSearchRequestBody().then(body => { + inspectorRequest.json(body); + }); + resp = await searchSource.fetch({ abortSignal }); + inspectorRequest.stats(getResponseInspectorStats(searchSource, resp)).ok({ json: resp }); + } catch (error) { + inspectorRequest.error({ error }); + throw error; + } + + return resp; +} From 30e5da77946a4c166ea2de220f28d9d53ebd36c1 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Tue, 31 Mar 2020 17:18:38 -0600 Subject: [PATCH 04/14] Init np kibana services in legacy plugin. Port init functions to np --- x-pack/legacy/plugins/maps/public/plugin.ts | 8 +++-- x-pack/plugins/maps/public/plugin.ts | 37 +++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/maps/public/plugin.ts b/x-pack/legacy/plugins/maps/public/plugin.ts index 53c951ac787e1..e6e5d67a3611d 100644 --- a/x-pack/legacy/plugins/maps/public/plugin.ts +++ b/x-pack/legacy/plugins/maps/public/plugin.ts @@ -26,7 +26,10 @@ import { setAutocompleteService, } from './kibana_services'; // @ts-ignore -import { setInjectedVarFunc as npSetInjectedVarFunc } from '../../../../plugins/maps/public/kibana_services'; // eslint-disable-line @kbn/eslint/no-restricted-paths +import { + bindSetupCoreAndPlugins as bindNpSetupCoreAndPlugins, + bindStartCoreAndPlugins as bindNpStartCoreAndPlugins, +} from '../../../../plugins/maps/public/plugin'; // eslint-disable-line @kbn/eslint/no-restricted-paths import { HomePublicPluginSetup } from '../../../../../src/plugins/home/public'; import { LicensingPluginSetup } from '../../../../plugins/licensing/public'; import { featureCatalogueEntry } from './feature_catalogue_entry'; @@ -68,7 +71,6 @@ export const bindSetupCoreAndPlugins = (core: CoreSetup, plugins: any) => { setHttp(http); setUiSettings(core.uiSettings); setInjectedVarFunc(core.injectedMetadata.getInjectedVar); - npSetInjectedVarFunc(core.injectedMetadata.getInjectedVar); setToasts(core.notifications.toasts); }; @@ -92,11 +94,13 @@ export class MapsPlugin implements Plugin { }); bindSetupCoreAndPlugins(core, np); + bindNpSetupCoreAndPlugins(core, np); np.home.featureCatalogue.register(featureCatalogueEntry); } public start(core: CoreStart, plugins: MapsPluginStartDependencies) { bindStartCoreAndPlugins(core, plugins); + bindNpStartCoreAndPlugins(core, plugins); } } diff --git a/x-pack/plugins/maps/public/plugin.ts b/x-pack/plugins/maps/public/plugin.ts index 506b0c426f0fa..9b44a38175d16 100644 --- a/x-pack/plugins/maps/public/plugin.ts +++ b/x-pack/plugins/maps/public/plugin.ts @@ -8,6 +8,19 @@ import { Plugin, CoreSetup, CoreStart } from 'src/core/public'; import { Setup as InspectorSetupContract } from 'src/plugins/inspector/public'; // @ts-ignore import { MapView } from './inspector/views/map_view'; +import { + setAutocompleteService, + setFileUpload, + setHttp, + setIndexPatternSelect, + setIndexPatternService, + setInjectedVarFunc, + setInspector, + setLicenseId, + setTimeFilter, + setToasts, + setUiSettings, +} from '../../../legacy/plugins/maps/public/kibana_services'; export interface MapsPluginSetupDependencies { inspector: InspectorSetupContract; @@ -15,6 +28,30 @@ export interface MapsPluginSetupDependencies { // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface MapsPluginStartDependencies {} +export const bindSetupCoreAndPlugins = (core: CoreSetup, plugins: any) => { + const { licensing } = plugins; + const { injectedMetadata, http } = core; + if (licensing) { + licensing.license$.subscribe(({ uid }: { uid: string }) => setLicenseId(uid)); + } + setInjectedVarFunc(injectedMetadata.getInjectedVar); + setHttp(http); + setUiSettings(core.uiSettings); + setInjectedVarFunc(core.injectedMetadata.getInjectedVar); + npSetInjectedVarFunc(core.injectedMetadata.getInjectedVar); + setToasts(core.notifications.toasts); +}; + +export const bindStartCoreAndPlugins = (core: CoreStart, plugins: any) => { + const { file_upload, data, inspector } = plugins; + setInspector(inspector); + setFileUpload(file_upload); + setIndexPatternSelect(data.ui.IndexPatternSelect); + setTimeFilter(data.query.timefilter.timefilter); + setIndexPatternService(data.indexPatterns); + setAutocompleteService(data.autocomplete); +}; + /** * These are the interfaces with your public contracts. You should export these * for other plugins to use in _their_ `SetupDeps`/`StartDeps` interfaces. From f1fd0d00e52b3eb8db4c55df43348bd6ad104cc1 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Wed, 1 Apr 2020 10:02:53 -0600 Subject: [PATCH 05/14] Path updates, supporting file moves, general clean up --- .../maps/public/angular/get_initial_layers.js | 3 +- .../public/angular/services/saved_gis_map.js | 3 +- .../connected_components/gis_map/view.js | 3 +- .../join_editor/resources/join_expression.js | 6 +- .../resources/metrics_expression.js | 3 +- .../layer_settings/layer_settings.js | 3 +- .../feature_geometry_filter_form.js | 3 +- .../map/mb/draw_control/draw_control.js | 3 +- .../connected_components/map/mb/utils.js | 63 +++---------------- .../connected_components/map/mb/view.js | 9 ++- .../components/add_tooltip_field_popover.js | 2 +- .../add_tooltip_field_popover.test.js | 0 .../maps/public/components/metric_editor.js | 0 .../maps/public/components/metric_select.js | 0 .../maps/public/components/metrics_editor.js | 0 .../components/no_index_pattern_callout.js | 8 +-- .../public/components/single_field_select.js | 2 +- .../public/components/tooltip_selector.js | 0 .../components/tooltip_selector.test.js | 0 .../maps/public/components/validated_range.js | 0 .../public/components/validated_range.test.js | 0 .../map/mb/image_utils.js | 0 .../connected_components/map/mb/utils.js | 62 ++++++++++++++++++ .../maps/public/elasticsearch_geo_utils.js | 0 .../public/elasticsearch_geo_utils.test.js | 2 +- .../plugins/maps/public/index_pattern_util.js | 2 +- .../maps/public/index_pattern_util.test.js | 0 .../public/layers/blended_vector_layer.ts | 4 +- .../public/layers/fields/ems_file_field.ts | 2 +- .../public/layers/fields/es_agg_field.test.ts | 2 +- .../maps/public/layers/fields/es_agg_field.ts | 4 +- .../maps/public/layers/fields/es_doc_field.ts | 4 +- .../maps/public/layers/fields/field.ts | 2 +- .../layers/fields/kibana_region_field.ts | 2 +- .../fields/top_term_percentage_field.ts | 4 +- .../maps/public/layers/heatmap_layer.js | 5 +- .../maps/public/layers/joins/inner_join.js | 5 +- x-pack/plugins/maps/public/layers/layer.d.ts | 2 +- x-pack/plugins/maps/public/layers/layer.js | 2 +- .../create_client_file_source_editor.js | 2 +- .../client_file_source/geojson_file_source.js | 2 +- .../ems_file_source/create_source_editor.js | 2 +- .../ems_file_source/ems_file_source.js | 6 +- .../ems_file_source/update_source_editor.js | 4 +- .../sources/ems_tms_source/ems_tms_source.js | 11 ++-- .../ems_tms_source/tile_service_select.js | 2 +- .../layers/sources/ems_unavailable_message.js | 2 +- .../public/layers/sources/es_agg_source.d.ts | 4 +- .../public/layers/sources/es_agg_source.js | 2 +- .../layers/sources/es_agg_source.test.ts | 4 +- .../es_geo_grid_source/convert_to_geojson.js | 4 +- .../convert_to_geojson.test.ts | 2 +- .../create_source_editor.js | 13 ++-- .../es_geo_grid_source.d.ts | 4 +- .../es_geo_grid_source/es_geo_grid_source.js | 4 +- .../es_geo_grid_source.test.ts | 6 +- .../es_geo_grid_source/geo_tile_utils.js | 4 +- .../es_geo_grid_source/resolution_editor.js | 2 +- .../update_source_editor.js | 6 +- .../es_pew_pew_source/create_source_editor.js | 9 +-- .../es_pew_pew_source/es_pew_pew_source.js | 4 +- .../es_pew_pew_source/update_source_editor.js | 4 +- .../es_search_source/create_source_editor.js | 16 ++--- .../es_search_source/es_search_source.d.ts | 2 +- .../es_search_source/es_search_source.js | 10 +-- .../es_search_source/es_search_source.test.ts | 6 +- .../es_search_source/load_index_settings.js | 4 +- .../es_search_source/scaling_form.test.tsx | 2 +- .../sources/es_search_source/scaling_form.tsx | 13 ++-- .../es_search_source/update_source_editor.js | 13 ++-- .../update_source_editor.test.js | 2 +- .../maps/public/layers/sources/es_source.d.ts | 2 +- .../maps/public/layers/sources/es_source.js | 6 +- .../public/layers/sources/es_term_source.js | 6 +- .../create_source_editor.js | 2 +- .../kibana_regionmap_source.js | 6 +- .../create_source_editor.js | 2 +- .../kibana_tilemap_source.js | 4 +- .../maps/public/layers/sources/source.d.ts | 2 +- .../public/layers/sources/vector_source.d.ts | 2 +- .../layers/sources/wms_source/wms_client.js | 2 +- .../layers/sources/wms_source/wms_source.js | 5 +- .../public/layers/sources/xyz_tms_source.d.ts | 2 +- .../public/layers/sources/xyz_tms_source.js | 7 +-- .../layers/sources/xyz_tms_source.test.ts | 4 +- .../maps/public/layers/styles/color_utils.js | 2 +- .../layers/styles/heatmap/heatmap_style.js | 5 +- .../components/color/color_map_select.js | 2 +- .../components/color/dynamic_color_form.js | 5 +- .../categorical_field_meta_popover.tsx | 2 +- .../field_meta/ordinal_field_meta_popover.tsx | 4 +- .../styles/vector/components/field_select.js | 2 +- .../components/get_vector_style_label.js | 2 +- .../vector_style_label_border_size_editor.js | 5 +- .../vector/components/legend/category.js | 2 +- .../extract_color_from_style_property.js | 5 +- .../orientation/static_orientation_form.js | 2 +- .../components/size/static_size_form.js | 2 +- .../vector/components/style_prop_editor.js | 2 +- .../vector/components/symbol/icon_stops.js | 2 +- .../symbol/vector_style_icon_editor.js | 2 +- .../vector_style_symbolize_as_editor.js | 5 +- .../vector/components/vector_style_editor.js | 2 +- .../properties/dynamic_color_property.js | 2 +- .../properties/dynamic_color_property.test.js | 6 +- .../dynamic_orientation_property.js | 2 +- .../properties/dynamic_size_property.js | 2 +- .../properties/dynamic_style_property.d.ts | 4 +- .../properties/dynamic_style_property.js | 2 +- .../properties/label_border_size_property.js | 2 +- .../properties/static_style_property.js | 2 +- .../vector/properties/style_property.ts | 7 +-- .../properties/symbolize_as_property.js | 2 +- .../public/layers/styles/vector/style_meta.ts | 2 +- .../layers/styles/vector/symbol_utils.js | 2 +- .../layers/styles/vector/vector_style.d.ts | 2 +- .../layers/styles/vector/vector_style.js | 2 +- .../layers/styles/vector/vector_style.test.js | 4 +- .../styles/vector/vector_style_defaults.ts | 6 +- .../maps/public/layers/tile_layer.d.ts | 2 +- .../plugins/maps/public/layers/tile_layer.js | 5 +- .../maps/public/layers/tile_layer.test.ts | 4 +- .../layers/util/assign_feature_ids.test.ts | 2 +- .../public/layers/util/assign_feature_ids.ts | 2 +- .../maps/public/layers/util/can_skip_fetch.ts | 2 +- .../maps/public/layers/util/data_request.ts | 5 +- .../maps/public/layers/util/es_agg_utils.ts | 2 +- .../public/layers/util/is_metric_countable.ts | 2 +- .../layers/util/mb_filter_expressions.ts | 5 +- .../maps/public/layers/vector_layer.d.ts | 2 +- .../maps/public/layers/vector_layer.js | 2 +- .../maps/public/layers/vector_tile_layer.js | 9 +-- .../{legacy => }/plugins/maps/public/meta.js | 25 ++++---- .../plugins/maps/public/meta.test.js | 0 134 files changed, 279 insertions(+), 330 deletions(-) rename x-pack/{legacy => }/plugins/maps/public/components/add_tooltip_field_popover.js (98%) rename x-pack/{legacy => }/plugins/maps/public/components/add_tooltip_field_popover.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/components/metric_editor.js (100%) rename x-pack/{legacy => }/plugins/maps/public/components/metric_select.js (100%) rename x-pack/{legacy => }/plugins/maps/public/components/metrics_editor.js (100%) rename x-pack/{legacy => }/plugins/maps/public/components/no_index_pattern_callout.js (85%) rename x-pack/{legacy => }/plugins/maps/public/components/single_field_select.js (95%) rename x-pack/{legacy => }/plugins/maps/public/components/tooltip_selector.js (100%) rename x-pack/{legacy => }/plugins/maps/public/components/tooltip_selector.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/components/validated_range.js (100%) rename x-pack/{legacy => }/plugins/maps/public/components/validated_range.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/connected_components/map/mb/image_utils.js (100%) create mode 100644 x-pack/plugins/maps/public/connected_components/map/mb/utils.js rename x-pack/{legacy => }/plugins/maps/public/elasticsearch_geo_utils.js (100%) rename x-pack/{legacy => }/plugins/maps/public/elasticsearch_geo_utils.test.js (99%) rename x-pack/{legacy => }/plugins/maps/public/index_pattern_util.js (95%) rename x-pack/{legacy => }/plugins/maps/public/index_pattern_util.test.js (100%) rename x-pack/{legacy => }/plugins/maps/public/meta.js (76%) rename x-pack/{legacy => }/plugins/maps/public/meta.test.js (100%) diff --git a/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.js b/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.js index 799b077d6d89c..5e497ff0736b2 100644 --- a/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.js +++ b/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.js @@ -9,7 +9,8 @@ import { KibanaTilemapSource } from '../../../../../plugins/maps/public/layers/s // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { EMSTMSSource } from '../../../../../plugins/maps/public/layers/sources/ems_tms_source'; import { getInjectedVarFunc } from '../kibana_services'; -import { getKibanaTileMap } from '../meta'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { getKibanaTileMap } from '../../../../../plugins/maps/public/meta'; export function getInitialLayers(layerListJSON, initialLayers = []) { if (layerListJSON) { diff --git a/x-pack/legacy/plugins/maps/public/angular/services/saved_gis_map.js b/x-pack/legacy/plugins/maps/public/angular/services/saved_gis_map.js index f846d3d4a617f..990a0613da681 100644 --- a/x-pack/legacy/plugins/maps/public/angular/services/saved_gis_map.js +++ b/x-pack/legacy/plugins/maps/public/angular/services/saved_gis_map.js @@ -17,7 +17,8 @@ import { getFilters, } from '../../selectors/map_selectors'; import { getIsLayerTOCOpen, getOpenTOCDetails } from '../../selectors/ui_selectors'; -import { convertMapExtentToPolygon } from '../../elasticsearch_geo_utils'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { convertMapExtentToPolygon } from '../../../../../../plugins/maps/public/elasticsearch_geo_utils'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { copyPersistentState } from '../../../../../../plugins/maps/public/reducers/util'; import { extractReferences, injectReferences } from '../../../common/migrations/references'; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/gis_map/view.js b/x-pack/legacy/plugins/maps/public/connected_components/gis_map/view.js index 97139103ab7c1..358313b8f5b6d 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/gis_map/view.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/gis_map/view.js @@ -13,7 +13,8 @@ import { LayerPanel } from '../layer_panel/index'; import { AddLayerPanel } from '../layer_addpanel/index'; import { EuiFlexGroup, EuiFlexItem, EuiCallOut } from '@elastic/eui'; import { ExitFullScreenButton } from 'ui/exit_full_screen'; -import { getIndexPatternsFromIds } from '../../index_pattern_util'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { getIndexPatternsFromIds } from '../../../../../../plugins/maps/public/index_pattern_util'; import { ES_GEO_FIELD_TYPE } from '../../../common/constants'; import { indexPatterns as indexPatternsUtils } from '../../../../../../../src/plugins/data/public'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/join_expression.js b/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/join_expression.js index f7edcf6e85e25..6c080ace4442a 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/join_expression.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/join_expression.js @@ -16,9 +16,11 @@ import { EuiFormHelpText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { SingleFieldSelect } from '../../../../components/single_field_select'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { SingleFieldSelect } from '../../../../../../../../plugins/maps/public/components/single_field_select'; import { FormattedMessage } from '@kbn/i18n/react'; -import { getTermsFields } from '../../../../index_pattern_util'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { getTermsFields } from '../../../../../../../../plugins/maps/public/index_pattern_util'; import { getIndexPatternService, getIndexPatternSelectComponent, diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/metrics_expression.js b/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/metrics_expression.js index 0944d0e602c2f..c6a79a398f9af 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/metrics_expression.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/metrics_expression.js @@ -14,7 +14,8 @@ import { EuiFormErrorText, EuiFormHelpText, } from '@elastic/eui'; -import { MetricsEditor } from '../../../../components/metrics_editor'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { MetricsEditor } from '../../../../../../../../plugins/maps/public/components/metrics_editor'; import { FormattedMessage } from '@kbn/i18n/react'; import { AGG_TYPE } from '../../../../../common/constants'; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/layer_settings/layer_settings.js b/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/layer_settings/layer_settings.js index eb23607aa2150..bd27450943638 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/layer_settings/layer_settings.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/layer_settings/layer_settings.js @@ -8,7 +8,8 @@ import React, { Fragment } from 'react'; import { EuiTitle, EuiPanel, EuiFormRow, EuiFieldText, EuiSpacer } from '@elastic/eui'; -import { ValidatedRange } from '../../../components/validated_range'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { ValidatedRange } from '../../../../../../../plugins/maps/public/components/validated_range'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { ValidatedDualRange } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/map/features_tooltip/feature_geometry_filter_form.js b/x-pack/legacy/plugins/maps/public/connected_components/map/features_tooltip/feature_geometry_filter_form.js index 416af95581058..7063c50edad6a 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/map/features_tooltip/feature_geometry_filter_form.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/map/features_tooltip/feature_geometry_filter_form.js @@ -8,7 +8,8 @@ import React, { Component, Fragment } from 'react'; import { EuiIcon } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { createSpatialFilterWithGeometry } from '../../../elasticsearch_geo_utils'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { createSpatialFilterWithGeometry } from '../../../../../../../plugins/maps/public/elasticsearch_geo_utils'; import { GEO_JSON_TYPE } from '../../../../common/constants'; import { GeometryFilterForm } from '../../../components/geometry_filter_form'; import { UrlOverflowService } from 'ui/error_url_overflow'; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/draw_control/draw_control.js b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/draw_control/draw_control.js index 99abe5d108b5a..df2988d399c5b 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/draw_control/draw_control.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/draw_control/draw_control.js @@ -16,7 +16,8 @@ import { createSpatialFilterWithGeometry, getBoundingBoxGeometry, roundCoordinates, -} from '../../../../elasticsearch_geo_utils'; + // eslint-disable-next-line @kbn/eslint/no-restricted-paths +} from '../../../../../../../../plugins/maps/public/elasticsearch_geo_utils'; import { DrawTooltip } from './draw_tooltip'; const mbDrawModes = MapboxDraw.modes; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/utils.js b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/utils.js index a2850d2bb6c23..a1d1341b7c4f7 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/utils.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/utils.js @@ -5,7 +5,13 @@ */ import _ from 'lodash'; -import { RGBAImage } from './image_utils'; +import { + loadSpriteSheetImageData, + addSpriteSheetToMapFromImageData, + // eslint-disable-next-line @kbn/eslint/no-restricted-paths +} from '../../../../../../../plugins/maps/public/connected_components/map/mb/utils'; + +export { loadSpriteSheetImageData, addSpriteSheetToMapFromImageData }; export function removeOrphanedSourcesAndLayers(mbMap, layerList) { const mbStyle = mbMap.getStyle(); @@ -95,62 +101,7 @@ export function syncLayerOrderForSingleLayer(mbMap, layerList) { }); } -function getImageData(img) { - const canvas = window.document.createElement('canvas'); - const context = canvas.getContext('2d'); - if (!context) { - throw new Error('failed to create canvas 2d context'); - } - canvas.width = img.width; - canvas.height = img.height; - context.drawImage(img, 0, 0, img.width, img.height); - return context.getImageData(0, 0, img.width, img.height); -} - -export async function loadSpriteSheetImageData(imgUrl) { - return new Promise((resolve, reject) => { - const image = new Image(); - if (isCrossOriginUrl(imgUrl)) { - image.crossOrigin = 'Anonymous'; - } - image.onload = el => { - const imgData = getImageData(el.currentTarget); - resolve(imgData); - }; - image.onerror = e => { - reject(e); - }; - image.src = imgUrl; - }); -} - -export function addSpriteSheetToMapFromImageData(json, imgData, mbMap) { - for (const imageId in json) { - if (!(json.hasOwnProperty(imageId) && !mbMap.hasImage(imageId))) { - continue; - } - const { width, height, x, y, sdf, pixelRatio } = json[imageId]; - if (typeof width !== 'number' || typeof height !== 'number') { - continue; - } - - const data = new RGBAImage({ width, height }); - RGBAImage.copy(imgData, data, { x, y }, { x: 0, y: 0 }, { width, height }); - mbMap.addImage(imageId, data, { pixelRatio, sdf }); - } -} - export async function addSpritesheetToMap(json, imgUrl, mbMap) { const imgData = await loadSpriteSheetImageData(imgUrl); addSpriteSheetToMapFromImageData(json, imgData, mbMap); } - -function isCrossOriginUrl(url) { - const a = window.document.createElement('a'); - a.href = url; - return ( - a.protocol !== window.document.location.protocol || - a.host !== window.document.location.host || - a.port !== window.document.location.port - ); -} diff --git a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js index fdc8ad2176d08..65d3ad431c93b 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js @@ -12,7 +12,8 @@ import { removeOrphanedSourcesAndLayers, addSpritesheetToMap, } from './utils'; -import { getGlyphUrl, isRetina } from '../../../meta'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { getGlyphUrl, isRetina } from '../../../../../../../plugins/maps/public/meta'; import { DECIMAL_DEGREES_PRECISION, ZOOM_PRECISION } from '../../../../common/constants'; import mapboxgl from 'mapbox-gl/dist/mapbox-gl-csp'; import mbWorkerUrl from '!!file-loader!mapbox-gl/dist/mapbox-gl-csp-worker'; @@ -23,7 +24,11 @@ import sprites1 from '@elastic/maki/dist/sprite@1.png'; import sprites2 from '@elastic/maki/dist/sprite@2.png'; import { DrawControl } from './draw_control'; import { TooltipControl } from './tooltip_control'; -import { clampToLatBounds, clampToLonBounds } from '../../../elasticsearch_geo_utils'; +import { + clampToLatBounds, + clampToLonBounds, + // eslint-disable-next-line @kbn/eslint/no-restricted-paths +} from '../../../../../../../plugins/maps/public/elasticsearch_geo_utils'; mapboxgl.workerUrl = mbWorkerUrl; mapboxgl.setRTLTextPlugin(mbRtlPlugin); diff --git a/x-pack/legacy/plugins/maps/public/components/add_tooltip_field_popover.js b/x-pack/plugins/maps/public/components/add_tooltip_field_popover.js similarity index 98% rename from x-pack/legacy/plugins/maps/public/components/add_tooltip_field_popover.js rename to x-pack/plugins/maps/public/components/add_tooltip_field_popover.js index 07bc54663c1d8..984ace4fd8708 100644 --- a/x-pack/legacy/plugins/maps/public/components/add_tooltip_field_popover.js +++ b/x-pack/plugins/maps/public/components/add_tooltip_field_popover.js @@ -17,7 +17,7 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { FieldIcon } from '../../../../../../src/plugins/kibana_react/public'; +import { FieldIcon } from '../../../../../src/plugins/kibana_react/public'; const sortByLabel = (a, b) => { return a.label.localeCompare(b.label); diff --git a/x-pack/legacy/plugins/maps/public/components/add_tooltip_field_popover.test.js b/x-pack/plugins/maps/public/components/add_tooltip_field_popover.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/components/add_tooltip_field_popover.test.js rename to x-pack/plugins/maps/public/components/add_tooltip_field_popover.test.js diff --git a/x-pack/legacy/plugins/maps/public/components/metric_editor.js b/x-pack/plugins/maps/public/components/metric_editor.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/components/metric_editor.js rename to x-pack/plugins/maps/public/components/metric_editor.js diff --git a/x-pack/legacy/plugins/maps/public/components/metric_select.js b/x-pack/plugins/maps/public/components/metric_select.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/components/metric_select.js rename to x-pack/plugins/maps/public/components/metric_select.js diff --git a/x-pack/legacy/plugins/maps/public/components/metrics_editor.js b/x-pack/plugins/maps/public/components/metrics_editor.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/components/metrics_editor.js rename to x-pack/plugins/maps/public/components/metrics_editor.js diff --git a/x-pack/legacy/plugins/maps/public/components/no_index_pattern_callout.js b/x-pack/plugins/maps/public/components/no_index_pattern_callout.js similarity index 85% rename from x-pack/legacy/plugins/maps/public/components/no_index_pattern_callout.js rename to x-pack/plugins/maps/public/components/no_index_pattern_callout.js index 3266f13155ca7..1319607546808 100644 --- a/x-pack/legacy/plugins/maps/public/components/no_index_pattern_callout.js +++ b/x-pack/plugins/maps/public/components/no_index_pattern_callout.js @@ -4,14 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import chrome from 'ui/chrome'; - +import { getHttp } from '../kibana_services'; import React from 'react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; export function NoIndexPatternCallout() { + const http = getHttp(); return ( - + - + { + const image = new Image(); + if (isCrossOriginUrl(imgUrl)) { + image.crossOrigin = 'Anonymous'; + } + image.onload = el => { + const imgData = getImageData(el.currentTarget); + resolve(imgData); + }; + image.onerror = e => { + reject(e); + }; + image.src = imgUrl; + }); +} + +export function addSpriteSheetToMapFromImageData(json, imgData, mbMap) { + for (const imageId in json) { + if (!(json.hasOwnProperty(imageId) && !mbMap.hasImage(imageId))) { + continue; + } + const { width, height, x, y, sdf, pixelRatio } = json[imageId]; + if (typeof width !== 'number' || typeof height !== 'number') { + continue; + } + + const data = new RGBAImage({ width, height }); + RGBAImage.copy(imgData, data, { x, y }, { x: 0, y: 0 }, { width, height }); + mbMap.addImage(imageId, data, { pixelRatio, sdf }); + } +} diff --git a/x-pack/legacy/plugins/maps/public/elasticsearch_geo_utils.js b/x-pack/plugins/maps/public/elasticsearch_geo_utils.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/elasticsearch_geo_utils.js rename to x-pack/plugins/maps/public/elasticsearch_geo_utils.js diff --git a/x-pack/legacy/plugins/maps/public/elasticsearch_geo_utils.test.js b/x-pack/plugins/maps/public/elasticsearch_geo_utils.test.js similarity index 99% rename from x-pack/legacy/plugins/maps/public/elasticsearch_geo_utils.test.js rename to x-pack/plugins/maps/public/elasticsearch_geo_utils.test.js index fb4b0a6e29e6c..5db7556be4639 100644 --- a/x-pack/legacy/plugins/maps/public/elasticsearch_geo_utils.test.js +++ b/x-pack/plugins/maps/public/elasticsearch_geo_utils.test.js @@ -20,7 +20,7 @@ import { convertMapExtentToPolygon, roundCoordinates, } from './elasticsearch_geo_utils'; -import { indexPatterns } from '../../../../../src/plugins/data/public'; +import { indexPatterns } from '../../../../src/plugins/data/public'; const geoFieldName = 'location'; const mapExtent = { diff --git a/x-pack/legacy/plugins/maps/public/index_pattern_util.js b/x-pack/plugins/maps/public/index_pattern_util.js similarity index 95% rename from x-pack/legacy/plugins/maps/public/index_pattern_util.js rename to x-pack/plugins/maps/public/index_pattern_util.js index 30a0a6826db83..6cb02c7605e28 100644 --- a/x-pack/legacy/plugins/maps/public/index_pattern_util.js +++ b/x-pack/plugins/maps/public/index_pattern_util.js @@ -5,7 +5,7 @@ */ import { getIndexPatternService } from './kibana_services'; -import { indexPatterns } from '../../../../../src/plugins/data/public'; +import { indexPatterns } from '../../../../src/plugins/data/public'; import { ES_GEO_FIELD_TYPE } from '../common/constants'; export async function getIndexPatternsFromIds(indexPatternIds = []) { diff --git a/x-pack/legacy/plugins/maps/public/index_pattern_util.test.js b/x-pack/plugins/maps/public/index_pattern_util.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/index_pattern_util.test.js rename to x-pack/plugins/maps/public/index_pattern_util.test.js diff --git a/x-pack/plugins/maps/public/layers/blended_vector_layer.ts b/x-pack/plugins/maps/public/layers/blended_vector_layer.ts index a86ce684a621b..0b080f5ef8df2 100644 --- a/x-pack/plugins/maps/public/layers/blended_vector_layer.ts +++ b/x-pack/plugins/maps/public/layers/blended_vector_layer.ts @@ -21,7 +21,7 @@ import { VECTOR_STYLES, LAYER_STYLE_TYPE, FIELD_ORIGIN, -} from '../../../../legacy/plugins/maps/common/constants'; +} from '../../common/constants'; import { ESGeoGridSource } from './sources/es_geo_grid_source/es_geo_grid_source'; import { canSkipSourceUpdate } from './util/can_skip_fetch'; import { IVectorLayer, VectorLayerArguments } from './vector_layer'; @@ -34,7 +34,7 @@ import { VectorStyleDescriptor, SizeDynamicOptions, DynamicStylePropertyOptions, -} from '../../../../legacy/plugins/maps/common/descriptor_types'; +} from '../../common/descriptor_types'; const ACTIVE_COUNT_DATA_ID = 'ACTIVE_COUNT_DATA_ID'; diff --git a/x-pack/plugins/maps/public/layers/fields/ems_file_field.ts b/x-pack/plugins/maps/public/layers/fields/ems_file_field.ts index a4056df68879f..c14886bc37bfb 100644 --- a/x-pack/plugins/maps/public/layers/fields/ems_file_field.ts +++ b/x-pack/plugins/maps/public/layers/fields/ems_file_field.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; +import { FIELD_ORIGIN } from '../../../common/constants'; import { IField, AbstractField } from './field'; import { IVectorSource } from '../sources/vector_source'; import { IEmsFileSource } from '../sources/ems_file_source/ems_file_source'; diff --git a/x-pack/plugins/maps/public/layers/fields/es_agg_field.test.ts b/x-pack/plugins/maps/public/layers/fields/es_agg_field.test.ts index 5c31804ebdadb..7a65b5f9f6b46 100644 --- a/x-pack/plugins/maps/public/layers/fields/es_agg_field.test.ts +++ b/x-pack/plugins/maps/public/layers/fields/es_agg_field.test.ts @@ -5,7 +5,7 @@ */ import { ESAggField, esAggFieldsFactory } from './es_agg_field'; -import { AGG_TYPE, FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; +import { AGG_TYPE, FIELD_ORIGIN } from '../../../common/constants'; import { IESAggSource } from '../sources/es_agg_source'; import { IIndexPattern } from 'src/plugins/data/public'; diff --git a/x-pack/plugins/maps/public/layers/fields/es_agg_field.ts b/x-pack/plugins/maps/public/layers/fields/es_agg_field.ts index daadf48358ddd..65f952ca01038 100644 --- a/x-pack/plugins/maps/public/layers/fields/es_agg_field.ts +++ b/x-pack/plugins/maps/public/layers/fields/es_agg_field.ts @@ -6,11 +6,11 @@ import { IndexPattern } from 'src/plugins/data/public'; import { IField } from './field'; -import { AggDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; +import { AggDescriptor } from '../../../common/descriptor_types'; import { IESAggSource } from '../sources/es_agg_source'; import { IVectorSource } from '../sources/vector_source'; import { ESDocField } from './es_doc_field'; -import { AGG_TYPE, FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; +import { AGG_TYPE, FIELD_ORIGIN } from '../../../common/constants'; import { isMetricCountable } from '../util/is_metric_countable'; import { getField, addFieldToDSL } from '../util/es_agg_utils'; import { TopTermPercentageField } from './top_term_percentage_field'; diff --git a/x-pack/plugins/maps/public/layers/fields/es_doc_field.ts b/x-pack/plugins/maps/public/layers/fields/es_doc_field.ts index 4153ebbcddff1..b7647d881fcf6 100644 --- a/x-pack/plugins/maps/public/layers/fields/es_doc_field.ts +++ b/x-pack/plugins/maps/public/layers/fields/es_doc_field.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; +import { FIELD_ORIGIN } from '../../../common/constants'; import { ESTooltipProperty } from '../tooltips/es_tooltip_property'; import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property'; -import { COLOR_PALETTE_MAX_SIZE } from '../../../../../legacy/plugins/maps/common/constants'; +import { COLOR_PALETTE_MAX_SIZE } from '../../../common/constants'; import { indexPatterns } from '../../../../../../src/plugins/data/public'; import { IFieldType } from '../../../../../../src/plugins/data/public'; import { IField, AbstractField } from './field'; diff --git a/x-pack/plugins/maps/public/layers/fields/field.ts b/x-pack/plugins/maps/public/layers/fields/field.ts index 78b17ed624b93..b431be4aa6cb8 100644 --- a/x-pack/plugins/maps/public/layers/fields/field.ts +++ b/x-pack/plugins/maps/public/layers/fields/field.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; +import { FIELD_ORIGIN } from '../../../common/constants'; import { IVectorSource } from '../sources/vector_source'; import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property'; diff --git a/x-pack/plugins/maps/public/layers/fields/kibana_region_field.ts b/x-pack/plugins/maps/public/layers/fields/kibana_region_field.ts index 82ecf8f905f24..9b619cf60a020 100644 --- a/x-pack/plugins/maps/public/layers/fields/kibana_region_field.ts +++ b/x-pack/plugins/maps/public/layers/fields/kibana_region_field.ts @@ -6,7 +6,7 @@ import { IField, AbstractField } from './field'; import { IKibanaRegionSource } from '../sources/kibana_regionmap_source/kibana_regionmap_source'; -import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; +import { FIELD_ORIGIN } from '../../../common/constants'; import { IVectorSource } from '../sources/vector_source'; export class KibanaRegionField extends AbstractField implements IField { diff --git a/x-pack/plugins/maps/public/layers/fields/top_term_percentage_field.ts b/x-pack/plugins/maps/public/layers/fields/top_term_percentage_field.ts index d67b8c32c3581..84bade4d94490 100644 --- a/x-pack/plugins/maps/public/layers/fields/top_term_percentage_field.ts +++ b/x-pack/plugins/maps/public/layers/fields/top_term_percentage_field.ts @@ -8,8 +8,8 @@ import { IESAggField } from './es_agg_field'; import { IVectorSource } from '../sources/vector_source'; // @ts-ignore import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property'; -import { TOP_TERM_PERCENTAGE_SUFFIX } from '../../../../../legacy/plugins/maps/common/constants'; -import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants'; +import { TOP_TERM_PERCENTAGE_SUFFIX } from '../../../common/constants'; +import { FIELD_ORIGIN } from '../../../common/constants'; export class TopTermPercentageField implements IESAggField { private readonly _topTermAggField: IESAggField; diff --git a/x-pack/plugins/maps/public/layers/heatmap_layer.js b/x-pack/plugins/maps/public/layers/heatmap_layer.js index 923c712051162..22f7a92c17c51 100644 --- a/x-pack/plugins/maps/public/layers/heatmap_layer.js +++ b/x-pack/plugins/maps/public/layers/heatmap_layer.js @@ -7,10 +7,7 @@ import { AbstractLayer } from './layer'; import { VectorLayer } from './vector_layer'; import { HeatmapStyle } from './styles/heatmap/heatmap_style'; -import { - EMPTY_FEATURE_COLLECTION, - LAYER_TYPE, -} from '../../../../legacy/plugins/maps/common/constants'; +import { EMPTY_FEATURE_COLLECTION, LAYER_TYPE } from '../../common/constants'; const SCALED_PROPERTY_NAME = '__kbn_heatmap_weight__'; //unique name to store scaled value for weighting diff --git a/x-pack/plugins/maps/public/layers/joins/inner_join.js b/x-pack/plugins/maps/public/layers/joins/inner_join.js index 3985bef6c0113..13a2e05ab8eeb 100644 --- a/x-pack/plugins/maps/public/layers/joins/inner_join.js +++ b/x-pack/plugins/maps/public/layers/joins/inner_join.js @@ -6,10 +6,7 @@ import { ESTermSource } from '../sources/es_term_source'; import { getComputedFieldNamePrefix } from '../styles/vector/style_util'; -import { - META_ID_ORIGIN_SUFFIX, - FORMATTERS_ID_ORIGIN_SUFFIX, -} from '../../../../../legacy/plugins/maps/common/constants'; +import { META_ID_ORIGIN_SUFFIX, FORMATTERS_ID_ORIGIN_SUFFIX } from '../../../common/constants'; export class InnerJoin { constructor(joinDescriptor, leftSource) { diff --git a/x-pack/plugins/maps/public/layers/layer.d.ts b/x-pack/plugins/maps/public/layers/layer.d.ts index 58b539787eb89..7b37e16fb37ee 100644 --- a/x-pack/plugins/maps/public/layers/layer.d.ts +++ b/x-pack/plugins/maps/public/layers/layer.d.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { LayerDescriptor } from '../../../../legacy/plugins/maps/common/descriptor_types'; +import { LayerDescriptor } from '../../common/descriptor_types'; import { ISource } from './sources/source'; import { DataRequest } from './util/data_request'; import { SyncContext } from '../../../../legacy/plugins/maps/public/actions/map_actions'; diff --git a/x-pack/plugins/maps/public/layers/layer.js b/x-pack/plugins/maps/public/layers/layer.js index d636f2db01025..fbcb86e6269e7 100644 --- a/x-pack/plugins/maps/public/layers/layer.js +++ b/x-pack/plugins/maps/public/layers/layer.js @@ -12,7 +12,7 @@ import { MB_SOURCE_ID_LAYER_ID_PREFIX_DELIMITER, MIN_ZOOM, SOURCE_DATA_ID_ORIGIN, -} from '../../../../legacy/plugins/maps/common/constants'; +} from '../../common/constants'; import uuid from 'uuid/v4'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { copyPersistentState } from '../reducers/util.js'; diff --git a/x-pack/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js b/x-pack/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js index fdd33843bae56..f9bfc4ddde91b 100644 --- a/x-pack/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/client_file_source/create_client_file_source_editor.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { getFileUploadComponent } from '../../../../../../legacy/plugins/maps/public/kibana_services'; +import { getFileUploadComponent } from '../../../kibana_services'; export function ClientFileCreateSourceEditor({ previewGeojsonFile, diff --git a/x-pack/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js b/x-pack/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js index 89bc6e896a476..a38669fcd1d1a 100644 --- a/x-pack/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js +++ b/x-pack/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js @@ -10,7 +10,7 @@ import { ES_GEO_FIELD_TYPE, GEOJSON_FILE, DEFAULT_MAX_RESULT_WINDOW, -} from '../../../../../../legacy/plugins/maps/common/constants'; +} from '../../../../common/constants'; import { ClientFileCreateSourceEditor } from './create_client_file_source_editor'; import { ESSearchSource } from '../es_search_source'; import uuid from 'uuid/v4'; diff --git a/x-pack/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js index 9ccc9f01df761..47a4879acb58c 100644 --- a/x-pack/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_file_source/create_source_editor.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiComboBox, EuiFormRow } from '@elastic/eui'; -import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta'; +import { getEMSClient } from '../../../meta'; import { getEmsUnavailableMessage } from '../ems_unavailable_message'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js b/x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js index b3d5dece05bd5..524f030862768 100644 --- a/x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_file_source/ems_file_source.js @@ -7,11 +7,11 @@ import { AbstractVectorSource } from '../vector_source'; import { VECTOR_SHAPE_TYPES } from '../vector_feature_types'; import React from 'react'; -import { EMS_FILE, FIELD_ORIGIN } from '../../../../../../legacy/plugins/maps/common/constants'; -import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta'; +import { EMS_FILE, FIELD_ORIGIN } from '../../../../common/constants'; +import { getEMSClient } from '../../../meta'; import { EMSFileCreateSourceEditor } from './create_source_editor'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; +import { getDataSourceLabel } from '../../../../common/i18n_getters'; import { UpdateSourceEditor } from './update_source_editor'; import { EMSFileField } from '../../fields/ems_file_field'; diff --git a/x-pack/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js b/x-pack/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js index 22ce345ef6cb0..b7687fec43272 100644 --- a/x-pack/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_file_source/update_source_editor.js @@ -6,8 +6,8 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { TooltipSelector } from '../../../../../../legacy/plugins/maps/public/components/tooltip_selector'; -import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta'; +import { TooltipSelector } from '../../../components/tooltip_selector'; +import { getEMSClient } from '../../../meta'; import { EuiTitle, EuiPanel, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; diff --git a/x-pack/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js index b0f93b2e2713f..5a2124622694c 100644 --- a/x-pack/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/ems_tms_source.js @@ -9,16 +9,13 @@ import React from 'react'; import { AbstractTMSSource } from '../tms_source'; import { VectorTileLayer } from '../../vector_tile_layer'; -import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta'; +import { getEMSClient } from '../../../meta'; import { TileServiceSelect } from './tile_service_select'; import { UpdateSourceEditor } from './update_source_editor'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; -import { EMS_TMS } from '../../../../../../legacy/plugins/maps/common/constants'; -import { - getInjectedVarFunc, - getUiSettings, -} from '../../../../../../legacy/plugins/maps/public/kibana_services'; +import { getDataSourceLabel } from '../../../../common/i18n_getters'; +import { EMS_TMS } from '../../../../common/constants'; +import { getInjectedVarFunc, getUiSettings } from '../../../kibana_services'; export class EMSTMSSource extends AbstractTMSSource { static type = EMS_TMS; diff --git a/x-pack/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js index ca28ef69650bf..337fc7aa46693 100644 --- a/x-pack/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_tms_source/tile_service_select.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiSelect, EuiFormRow } from '@elastic/eui'; -import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta'; +import { getEMSClient } from '../../../meta'; import { getEmsUnavailableMessage } from '../ems_unavailable_message'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/maps/public/layers/sources/ems_unavailable_message.js b/x-pack/plugins/maps/public/layers/sources/ems_unavailable_message.js index 7b28d47345458..bc50890a0f4a3 100644 --- a/x-pack/plugins/maps/public/layers/sources/ems_unavailable_message.js +++ b/x-pack/plugins/maps/public/layers/sources/ems_unavailable_message.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getInjectedVarFunc } from '../../../../../legacy/plugins/maps/public/kibana_services'; +import { getInjectedVarFunc } from '../../kibana_services'; import { i18n } from '@kbn/i18n'; export function getEmsUnavailableMessage() { diff --git a/x-pack/plugins/maps/public/layers/sources/es_agg_source.d.ts b/x-pack/plugins/maps/public/layers/sources/es_agg_source.d.ts index f78a70c9304fd..99ee1ec652b54 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_agg_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_agg_source.d.ts @@ -6,9 +6,9 @@ import { IESSource } from './es_source'; import { AbstractESSource } from './es_source'; -import { AGG_TYPE } from '../../../../../legacy/plugins/maps/common/constants'; +import { AGG_TYPE } from '../../../common/constants'; import { IESAggField } from '../fields/es_agg_field'; -import { AbstractESAggSourceDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; +import { AbstractESAggSourceDescriptor } from '../../../common/descriptor_types'; export interface IESAggSource extends IESSource { getAggKey(aggType: AGG_TYPE, fieldName: string): string; diff --git a/x-pack/plugins/maps/public/layers/sources/es_agg_source.js b/x-pack/plugins/maps/public/layers/sources/es_agg_source.js index 995b98649acc5..9f4b89cadc777 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_agg_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_agg_source.js @@ -13,7 +13,7 @@ import { COUNT_PROP_LABEL, COUNT_PROP_NAME, FIELD_ORIGIN, -} from '../../../../../legacy/plugins/maps/common/constants'; +} from '../../../common/constants'; export const AGG_DELIMITER = '_of_'; diff --git a/x-pack/plugins/maps/public/layers/sources/es_agg_source.test.ts b/x-pack/plugins/maps/public/layers/sources/es_agg_source.test.ts index 7f106380a2dcb..848091586eb9c 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_agg_source.test.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_agg_source.test.ts @@ -8,8 +8,8 @@ import { AbstractESAggSource } from './es_agg_source'; import { IField } from '../fields/field'; import { IESAggField } from '../fields/es_agg_field'; import _ from 'lodash'; -import { AGG_TYPE } from '../../../../../legacy/plugins/maps/common/constants'; -import { AggDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; +import { AGG_TYPE } from '../../../common/constants'; +import { AggDescriptor } from '../../../common/descriptor_types'; jest.mock('ui/new_platform'); diff --git a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js index 926968b058efa..121ce3c7ffe92 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.js @@ -5,10 +5,10 @@ */ import _ from 'lodash'; -import { RENDER_AS } from '../../../../../../legacy/plugins/maps/common/constants'; +import { RENDER_AS } from '../../../../common/constants'; import { getTileBoundingBox } from './geo_tile_utils'; import { extractPropertiesFromBucket } from '../../util/es_agg_utils'; -import { clamp } from '../../../../../../legacy/plugins/maps/public/elasticsearch_geo_utils'; +import { clamp } from '../../../elasticsearch_geo_utils'; const GRID_BUCKET_KEYS_TO_IGNORE = ['key', 'gridCentroid']; diff --git a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts index d4cd19ed6e325..e79d8e09fce9b 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.ts @@ -8,7 +8,7 @@ jest.mock('../../../kibana_services', () => {}); // @ts-ignore import { convertCompositeRespToGeoJson, convertRegularRespToGeoJson } from './convert_to_geojson'; -import { RENDER_AS } from '../../../../../../legacy/plugins/maps/common/constants'; +import { RENDER_AS } from '../../../../common/constants'; describe('convertCompositeRespToGeoJson', () => { const esResponse = { diff --git a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js index e18e6fe86b1f0..148683269ef78 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js @@ -8,20 +8,17 @@ import _ from 'lodash'; import React, { Fragment, Component } from 'react'; import PropTypes from 'prop-types'; -import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/components/single_field_select'; -import { RENDER_AS } from '../../../../../../legacy/plugins/maps/common/constants'; -import { - getIndexPatternService, - getIndexPatternSelectComponent, -} from '../../../../../../legacy/plugins/maps/public/kibana_services'; -import { NoIndexPatternCallout } from '../../../../../../legacy/plugins/maps/public/components/no_index_pattern_callout'; +import { SingleFieldSelect } from '../../../components/single_field_select'; +import { RENDER_AS } from '../../../../common/constants'; +import { getIndexPatternService, getIndexPatternSelectComponent } from '../../../kibana_services'; +import { NoIndexPatternCallout } from '../../../components/no_index_pattern_callout'; import { i18n } from '@kbn/i18n'; import { EuiFormRow, EuiComboBox, EuiSpacer } from '@elastic/eui'; import { AGGREGATABLE_GEO_FIELD_TYPES, getAggregatableGeoFields, -} from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; +} from '../../../index_pattern_util'; const requestTypeOptions = [ { diff --git a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts index 41c2cfc266ad2..3f596cea1ae39 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts @@ -5,8 +5,8 @@ */ import { AbstractESAggSource } from '../es_agg_source'; -import { ESGeoGridSourceDescriptor } from '../../../../../../legacy/plugins/maps/common/descriptor_types'; -import { GRID_RESOLUTION, RENDER_AS } from '../../../../../../legacy/plugins/maps/common/constants'; +import { ESGeoGridSourceDescriptor } from '../../../../common/descriptor_types'; +import { GRID_RESOLUTION, RENDER_AS } from '../../../../common/constants'; export class ESGeoGridSource extends AbstractESAggSource { static createDescriptor({ diff --git a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js index 2e27d467d51f8..405c8a61bfca6 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js @@ -25,9 +25,9 @@ import { GRID_RESOLUTION, VECTOR_STYLES, FIELD_ORIGIN, -} from '../../../../../../legacy/plugins/maps/common/constants'; +} from '../../../../common/constants'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; +import { getDataSourceLabel } from '../../../../common/i18n_getters'; import { AbstractESAggSource } from '../es_agg_source'; import { DynamicStyleProperty } from '../../styles/vector/properties/dynamic_style_property'; import { StaticStyleProperty } from '../../styles/vector/properties/static_style_property'; diff --git a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts index 2d73102fc9e93..727435c3cbfef 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts @@ -7,11 +7,7 @@ jest.mock('../../../kibana_services', () => {}); jest.mock('ui/new_platform'); import { ESGeoGridSource } from './es_geo_grid_source'; -import { - ES_GEO_GRID, - GRID_RESOLUTION, - RENDER_AS, -} from '../../../../../../legacy/plugins/maps/common/constants'; +import { ES_GEO_GRID, GRID_RESOLUTION, RENDER_AS } from '../../../../common/constants'; describe('ESGeoGridSource', () => { const geogridSource = new ESGeoGridSource( diff --git a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js index a3b99ebdabfbf..251e33b9579cb 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js @@ -5,8 +5,8 @@ */ import _ from 'lodash'; -import { DECIMAL_DEGREES_PRECISION } from '../../../../../../legacy/plugins/maps/common/constants'; -import { clampToLatBounds } from '../../../../../../legacy/plugins/maps/public/elasticsearch_geo_utils'; +import { DECIMAL_DEGREES_PRECISION } from '../../../../common/constants'; +import { clampToLatBounds } from '../../../elasticsearch_geo_utils'; const ZOOM_TILE_KEY_INDEX = 0; const X_TILE_KEY_INDEX = 1; diff --git a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js index e7842350b745e..b2314dd007509 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/resolution_editor.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { GRID_RESOLUTION } from '../../../../../../legacy/plugins/maps/common/constants'; +import { GRID_RESOLUTION } from '../../../../common/constants'; import { EuiSelect, EuiFormRow } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js index cf15266ba5729..cd494db3897fb 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/update_source_editor.js @@ -6,9 +6,9 @@ import React, { Fragment, Component } from 'react'; -import { RENDER_AS } from '../../../../../../legacy/plugins/maps/common/constants'; -import { MetricsEditor } from '../../../../../../legacy/plugins/maps/public/components/metrics_editor'; -import { getIndexPatternService } from '../../../../../../legacy/plugins/maps/public/kibana_services'; +import { RENDER_AS } from '../../../../common/constants'; +import { MetricsEditor } from '../../../components/metrics_editor'; +import { getIndexPatternService } from '../../../kibana_services'; import { ResolutionEditor } from './resolution_editor'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; diff --git a/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js index c4d0414b94015..a4af1a3c19c83 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js @@ -8,11 +8,8 @@ import _ from 'lodash'; import React, { Fragment, Component } from 'react'; import PropTypes from 'prop-types'; -import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/components/single_field_select'; -import { - getIndexPatternService, - getIndexPatternSelectComponent, -} from '../../../../../../legacy/plugins/maps/public/kibana_services'; +import { SingleFieldSelect } from '../../../components/single_field_select'; +import { getIndexPatternService, getIndexPatternSelectComponent } from '../../../kibana_services'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -20,7 +17,7 @@ import { EuiFormRow, EuiCallOut } from '@elastic/eui'; import { AGGREGATABLE_GEO_FIELD_TYPES, getAggregatableGeoFields, -} from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; +} from '../../../index_pattern_util'; export class CreateSourceEditor extends Component { static propTypes = { diff --git a/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js index aafa5bc0c4220..025c4545d15bb 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/es_pew_pew_source.js @@ -19,8 +19,8 @@ import { ES_PEW_PEW, COUNT_PROP_NAME, VECTOR_STYLES, -} from '../../../../../../legacy/plugins/maps/common/constants'; -import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; +} from '../../../../common/constants'; +import { getDataSourceLabel } from '../../../../common/i18n_getters'; import { convertToLines } from './convert_to_lines'; import { AbstractESAggSource } from '../es_agg_source'; import { DynamicStyleProperty } from '../../styles/vector/properties/dynamic_style_property'; diff --git a/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js index f4760941f8d0b..dea59a1c82f8a 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/update_source_editor.js @@ -6,8 +6,8 @@ import React, { Component, Fragment } from 'react'; -import { MetricsEditor } from '../../../../../../legacy/plugins/maps/public/components/metrics_editor'; -import { getIndexPatternService } from '../../../../../../legacy/plugins/maps/public/kibana_services'; +import { MetricsEditor } from '../../../components/metrics_editor'; +import { getIndexPatternService } from '../../../kibana_services'; import { i18n } from '@kbn/i18n'; import { EuiPanel, EuiTitle, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js index 1c7fe97beb7fa..aeb3835354f07 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js @@ -9,21 +9,15 @@ import React, { Fragment, Component } from 'react'; import PropTypes from 'prop-types'; import { EuiFormRow, EuiSpacer } from '@elastic/eui'; -import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/components/single_field_select'; -import { - getIndexPatternService, - getIndexPatternSelectComponent, -} from '../../../../../../legacy/plugins/maps/public/kibana_services'; -import { NoIndexPatternCallout } from '../../../../../../legacy/plugins/maps/public/components/no_index_pattern_callout'; +import { SingleFieldSelect } from '../../../components/single_field_select'; +import { getIndexPatternService, getIndexPatternSelectComponent } from '../../../kibana_services'; +import { NoIndexPatternCallout } from '../../../components/no_index_pattern_callout'; import { i18n } from '@kbn/i18n'; -import { - ES_GEO_FIELD_TYPE, - SCALING_TYPES, -} from '../../../../../../legacy/plugins/maps/common/constants'; +import { ES_GEO_FIELD_TYPE, SCALING_TYPES } from '../../../../common/constants'; import { DEFAULT_FILTER_BY_MAP_BOUNDS } from './constants'; import { indexPatterns } from '../../../../../../../src/plugins/data/public'; import { ScalingForm } from './scaling_form'; -import { getTermsFields } from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; +import { getTermsFields } from '../../../index_pattern_util'; function getGeoFields(fields) { return fields.filter(field => { diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts index 58f9d4a43d49f..0a4e48a195ec6 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.d.ts @@ -5,7 +5,7 @@ */ import { AbstractESSource } from '../es_source'; -import { ESSearchSourceDescriptor } from '../../../../../../legacy/plugins/maps/common/descriptor_types'; +import { ESSearchSourceDescriptor } from '../../../../common/descriptor_types'; export class ESSearchSource extends AbstractESSource { constructor(sourceDescriptor: Partial, inspectorAdapters: unknown); diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.js index fdcd6d5a144db..cd44ef49623fa 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.js @@ -10,10 +10,10 @@ import uuid from 'uuid/v4'; import { VECTOR_SHAPE_TYPES } from '../vector_feature_types'; import { AbstractESSource } from '../es_source'; -import { SearchSource } from '../../../../../../legacy/plugins/maps/public/kibana_services'; +import { SearchSource } from '../../../kibana_services'; import { VectorStyle } from '../../styles/vector/vector_style'; import { VectorLayer } from '../../vector_layer'; -import { hitsToGeoJson } from '../../../../../../legacy/plugins/maps/public/elasticsearch_geo_utils'; +import { hitsToGeoJson } from '../../../elasticsearch_geo_utils'; import { CreateSourceEditor } from './create_source_editor'; import { UpdateSourceEditor } from './update_source_editor'; import { @@ -22,10 +22,10 @@ import { DEFAULT_MAX_BUCKETS_LIMIT, SORT_ORDER, SCALING_TYPES, -} from '../../../../../../legacy/plugins/maps/common/constants'; +} from '../../../../common/constants'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; -import { getSourceFields } from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; +import { getDataSourceLabel } from '../../../../common/i18n_getters'; +import { getSourceFields } from '../../../index_pattern_util'; import { loadIndexSettings } from './load_index_settings'; import { BlendedVectorLayer } from '../../blended_vector_layer'; diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts index 452bd8cba8c73..2197e24aedb59 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/es_search_source.test.ts @@ -8,8 +8,8 @@ jest.mock('../../../kibana_services'); import { ESSearchSource } from './es_search_source'; import { VectorLayer } from '../../vector_layer'; -import { ES_SEARCH, SCALING_TYPES } from '../../../../../../legacy/plugins/maps/common/constants'; -import { ESSearchSourceDescriptor } from '../../../../../../legacy/plugins/maps/common/descriptor_types'; +import { ES_SEARCH, SCALING_TYPES } from '../../../../common/constants'; +import { ESSearchSourceDescriptor } from '../../../../common/descriptor_types'; const descriptor: ESSearchSourceDescriptor = { type: ES_SEARCH, @@ -21,7 +21,7 @@ const descriptor: ESSearchSourceDescriptor = { describe('ES Search Source', () => { beforeEach(() => { - require('../../../../../../legacy/plugins/maps/public/kibana_services').getUiSettings = () => ({ + require('../../../kibana_services').getUiSettings = () => ({ get: jest.fn(), }); }); diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js index 429190bdc3eae..811291de26d35 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/load_index_settings.js @@ -8,8 +8,8 @@ import { DEFAULT_MAX_RESULT_WINDOW, DEFAULT_MAX_INNER_RESULT_WINDOW, INDEX_SETTINGS_API_PATH, -} from '../../../../../../legacy/plugins/maps/common/constants'; -import { getHttp, getToasts } from '../../../../../../legacy/plugins/maps/public/kibana_services'; +} from '../../../../common/constants'; +import { getHttp, getToasts } from '../../../kibana_services'; import { i18n } from '@kbn/i18n'; let toastDisplayed = false; diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx index b851c1137a058..03f29685891ec 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.test.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { ScalingForm } from './scaling_form'; -import { SCALING_TYPES } from '../../../../../../legacy/plugins/maps/common/constants'; +import { SCALING_TYPES } from '../../../../common/constants'; const defaultProps = { filterByMapBounds: true, diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx index ee8ecc27a0b54..b03a733f2164e 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx @@ -17,23 +17,18 @@ import { import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; // @ts-ignore -import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/components/single_field_select'; +import { SingleFieldSelect } from '../../../components/single_field_select'; // @ts-ignore -import { indexPatternService } from '../../../../../../legacy/plugins/maps/public/kibana_services'; -import { - getTermsFields, - getSourceFields, - // @ts-ignore -} from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; +import { indexPatternService } from '../../../kibana_services'; // @ts-ignore -import { ValidatedRange } from '../../../../../../legacy/plugins/maps/public/components/validated_range'; +import { ValidatedRange } from '../../../components/validated_range'; import { DEFAULT_MAX_INNER_RESULT_WINDOW, DEFAULT_MAX_RESULT_WINDOW, SCALING_TYPES, LAYER_TYPE, -} from '../../../../../../legacy/plugins/maps/common/constants'; +} from '../../../../common/constants'; // @ts-ignore import { loadIndexSettings } from './load_index_settings'; import { IFieldType } from '../../../../../../../src/plugins/data/public'; diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js index 9a735e4e7f32a..cb6255afd0a42 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js @@ -7,16 +7,13 @@ import React, { Fragment, Component } from 'react'; import PropTypes from 'prop-types'; import { EuiFormRow, EuiSelect, EuiTitle, EuiPanel, EuiSpacer } from '@elastic/eui'; -import { SingleFieldSelect } from '../../../../../../legacy/plugins/maps/public/components/single_field_select'; -import { TooltipSelector } from '../../../../../../legacy/plugins/maps/public/components/tooltip_selector'; +import { SingleFieldSelect } from '../../../components/single_field_select'; +import { TooltipSelector } from '../../../components/tooltip_selector'; -import { getIndexPatternService } from '../../../../../../legacy/plugins/maps/public/kibana_services'; +import { getIndexPatternService } from '../../../kibana_services'; import { i18n } from '@kbn/i18n'; -import { - getTermsFields, - getSourceFields, -} from '../../../../../../legacy/plugins/maps/public/index_pattern_util'; -import { SORT_ORDER } from '../../../../../../legacy/plugins/maps/common/constants'; +import { getTermsFields, getSourceFields } from '../../../index_pattern_util'; +import { SORT_ORDER } from '../../../../common/constants'; import { ESDocField } from '../../fields/es_doc_field'; import { FormattedMessage } from '@kbn/i18n/react'; import { indexPatterns } from '../../../../../../../src/plugins/data/public'; diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js index 8b95726be326f..65a91ce03994a 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.test.js @@ -16,7 +16,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { UpdateSourceEditor } from './update_source_editor'; -import { SCALING_TYPES } from '../../../../../../legacy/plugins/maps/common/constants'; +import { SCALING_TYPES } from '../../../../common/constants'; const defaultProps = { indexPatternId: 'indexPattern1', diff --git a/x-pack/plugins/maps/public/layers/sources/es_source.d.ts b/x-pack/plugins/maps/public/layers/sources/es_source.d.ts index 542c9f01e5144..65851d0e7bd38 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/es_source.d.ts @@ -7,7 +7,7 @@ import { AbstractVectorSource } from './vector_source'; import { IVectorSource } from './vector_source'; import { IndexPattern, SearchSource } from '../../../../../../src/plugins/data/public'; -import { VectorSourceRequestMeta } from '../../../../../legacy/plugins/maps/common/descriptor_types'; +import { VectorSourceRequestMeta } from '../../../common/descriptor_types'; export interface IESSource extends IVectorSource { getId(): string; diff --git a/x-pack/plugins/maps/public/layers/sources/es_source.js b/x-pack/plugins/maps/public/layers/sources/es_source.js index 099de3a1e0644..12d89675a9f30 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_source.js @@ -11,14 +11,14 @@ import { getIndexPatternService, SearchSource, getTimeFilter, -} from '../../../../../legacy/plugins/maps/public/kibana_services'; -import { createExtentFilter } from '../../../../../legacy/plugins/maps/public/elasticsearch_geo_utils'; +} from '../../kibana_services'; +import { createExtentFilter } from '../../elasticsearch_geo_utils'; import _ from 'lodash'; import { i18n } from '@kbn/i18n'; import uuid from 'uuid/v4'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { copyPersistentState } from '../../reducers/util'; -import { ES_GEO_FIELD_TYPE } from '../../../../../legacy/plugins/maps/common/constants'; +import { ES_GEO_FIELD_TYPE } from '../../../common/constants'; import { DataRequestAbortError } from '../util/data_request'; import { expandToTileBoundaries } from './es_geo_grid_source/geo_tile_utils'; diff --git a/x-pack/plugins/maps/public/layers/sources/es_term_source.js b/x-pack/plugins/maps/public/layers/sources/es_term_source.js index dbe4759852292..3ce0fb58aba19 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_term_source.js +++ b/x-pack/plugins/maps/public/layers/sources/es_term_source.js @@ -7,11 +7,7 @@ import _ from 'lodash'; import { i18n } from '@kbn/i18n'; -import { - DEFAULT_MAX_BUCKETS_LIMIT, - FIELD_ORIGIN, - AGG_TYPE, -} from '../../../../../legacy/plugins/maps/common/constants'; +import { DEFAULT_MAX_BUCKETS_LIMIT, FIELD_ORIGIN, AGG_TYPE } from '../../../common/constants'; import { ESDocField } from '../fields/es_doc_field'; import { AbstractESAggSource, AGG_DELIMITER } from './es_agg_source'; import { getField, addFieldToDSL, extractPropertiesFromBucket } from '../util/es_agg_utils'; diff --git a/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js index 2fffec9e97c9d..5e28916e79f3f 100644 --- a/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/create_source_editor.js @@ -7,7 +7,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { EuiSelect, EuiFormRow } from '@elastic/eui'; -import { getKibanaRegionList } from '../../../../../../legacy/plugins/maps/public/meta'; +import { getKibanaRegionList } from '../../../meta'; import { i18n } from '@kbn/i18n'; export function CreateSourceEditor({ onSourceConfigChange }) { diff --git a/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js b/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js index d26181899d0f4..276a3377aaae2 100644 --- a/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js +++ b/x-pack/plugins/maps/public/layers/sources/kibana_regionmap_source/kibana_regionmap_source.js @@ -7,10 +7,10 @@ import { AbstractVectorSource } from '../vector_source'; import React from 'react'; import { CreateSourceEditor } from './create_source_editor'; -import { getKibanaRegionList } from '../../../../../../legacy/plugins/maps/public/meta'; +import { getKibanaRegionList } from '../../../meta'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; -import { FIELD_ORIGIN } from '../../../../../../legacy/plugins/maps/common/constants'; +import { getDataSourceLabel } from '../../../../common/i18n_getters'; +import { FIELD_ORIGIN } from '../../../../common/constants'; import { KibanaRegionField } from '../../fields/kibana_region_field'; export class KibanaRegionmapSource extends AbstractVectorSource { diff --git a/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js index 85804f4cfc255..a0a507ff9d32d 100644 --- a/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/create_source_editor.js @@ -8,7 +8,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { EuiFieldText, EuiFormRow } from '@elastic/eui'; -import { getKibanaTileMap } from '../../../../../../legacy/plugins/maps/public/meta'; +import { getKibanaTileMap } from '../../../meta'; import { i18n } from '@kbn/i18n'; export function CreateSourceEditor({ onSourceConfigChange }) { diff --git a/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js b/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js index f4f76a22ca4d1..21ab2ba42c7bb 100644 --- a/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js +++ b/x-pack/plugins/maps/public/layers/sources/kibana_tilemap_source/kibana_tilemap_source.js @@ -7,9 +7,9 @@ import React from 'react'; import { AbstractTMSSource } from '../tms_source'; import { TileLayer } from '../../tile_layer'; import { CreateSourceEditor } from './create_source_editor'; -import { getKibanaTileMap } from '../../../../../../legacy/plugins/maps/public/meta'; +import { getKibanaTileMap } from '../../../meta'; import { i18n } from '@kbn/i18n'; -import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters'; +import { getDataSourceLabel } from '../../../../common/i18n_getters'; import _ from 'lodash'; export class KibanaTilemapSource extends AbstractTMSSource { diff --git a/x-pack/plugins/maps/public/layers/sources/source.d.ts b/x-pack/plugins/maps/public/layers/sources/source.d.ts index 14fac48d2f17b..e1706ad7b7d77 100644 --- a/x-pack/plugins/maps/public/layers/sources/source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/source.d.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AbstractSourceDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; +import { AbstractSourceDescriptor } from '../../../common/descriptor_types'; import { ILayer } from '../layer'; export interface ISource { diff --git a/x-pack/plugins/maps/public/layers/sources/vector_source.d.ts b/x-pack/plugins/maps/public/layers/sources/vector_source.d.ts index 4248c9b498070..7a747da244233 100644 --- a/x-pack/plugins/maps/public/layers/sources/vector_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/vector_source.d.ts @@ -8,7 +8,7 @@ import { FeatureCollection } from 'geojson'; import { AbstractSource, ISource } from './source'; import { IField } from '../fields/field'; -import { ESSearchSourceResponseMeta } from '../../../../../legacy/plugins/maps/common/descriptor_types'; +import { ESSearchSourceResponseMeta } from '../../../common/descriptor_types'; export type GeoJsonFetchMeta = ESSearchSourceResponseMeta; diff --git a/x-pack/plugins/maps/public/layers/sources/wms_source/wms_client.js b/x-pack/plugins/maps/public/layers/sources/wms_source/wms_client.js index 40c33182e2ec7..2d897f7c9227b 100644 --- a/x-pack/plugins/maps/public/layers/sources/wms_source/wms_client.js +++ b/x-pack/plugins/maps/public/layers/sources/wms_source/wms_client.js @@ -5,7 +5,7 @@ */ import _ from 'lodash'; -import { parseXmlString } from '../../../../../../legacy/plugins/maps/common/parse_xml_string'; +import { parseXmlString } from '../../../../common/parse_xml_string'; import fetch from 'node-fetch'; import { parse, format } from 'url'; diff --git a/x-pack/plugins/maps/public/layers/sources/wms_source/wms_source.js b/x-pack/plugins/maps/public/layers/sources/wms_source/wms_source.js index a8d5dfa9beee3..61955df94e451 100644 --- a/x-pack/plugins/maps/public/layers/sources/wms_source/wms_source.js +++ b/x-pack/plugins/maps/public/layers/sources/wms_source/wms_source.js @@ -10,10 +10,7 @@ import { AbstractTMSSource } from '../tms_source'; import { TileLayer } from '../../tile_layer'; import { WMSCreateSourceEditor } from './wms_create_source_editor'; import { i18n } from '@kbn/i18n'; -import { - getDataSourceLabel, - getUrlLabel, -} from '../../../../../../legacy/plugins/maps/common/i18n_getters'; +import { getDataSourceLabel, getUrlLabel } from '../../../../common/i18n_getters'; import { WmsClient } from './wms_client'; export class WMSSource extends AbstractTMSSource { diff --git a/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.d.ts b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.d.ts index efb8db7ee7153..579c9debeab3e 100644 --- a/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.d.ts +++ b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.d.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { AbstractTMSSource } from './tms_source'; -import { XYZTMSSourceDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; +import { XYZTMSSourceDescriptor } from '../../../common/descriptor_types'; export class XYZTMSSource extends AbstractTMSSource { constructor(sourceDescriptor: XYZTMSSourceDescriptor, inspectorAdapters: unknown); diff --git a/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.js b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.js index 10decaa5e7ade..354883372e244 100644 --- a/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.js +++ b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.js @@ -10,12 +10,9 @@ import { EuiFieldText, EuiFormRow } from '@elastic/eui'; import { AbstractTMSSource } from './tms_source'; import { TileLayer } from '../tile_layer'; import { i18n } from '@kbn/i18n'; -import { - getDataSourceLabel, - getUrlLabel, -} from '../../../../../legacy/plugins/maps/common/i18n_getters'; +import { getDataSourceLabel, getUrlLabel } from '../../../common/i18n_getters'; import _ from 'lodash'; -import { EMS_XYZ } from '../../../../../legacy/plugins/maps/common/constants'; +import { EMS_XYZ } from '../../../common/constants'; export class XYZTMSSource extends AbstractTMSSource { static type = EMS_XYZ; diff --git a/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.test.ts b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.test.ts index ae010141fb940..e5ab5e57122ba 100644 --- a/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.test.ts +++ b/x-pack/plugins/maps/public/layers/sources/xyz_tms_source.test.ts @@ -7,8 +7,8 @@ import { XYZTMSSource } from './xyz_tms_source'; import { ILayer } from '../layer'; import { TileLayer } from '../tile_layer'; -import { EMS_XYZ } from '../../../../../legacy/plugins/maps/common/constants'; -import { XYZTMSSourceDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types'; +import { EMS_XYZ } from '../../../common/constants'; +import { XYZTMSSourceDescriptor } from '../../../common/descriptor_types'; const descriptor: XYZTMSSourceDescriptor = { type: EMS_XYZ, diff --git a/x-pack/plugins/maps/public/layers/styles/color_utils.js b/x-pack/plugins/maps/public/layers/styles/color_utils.js index 81d63eaadb673..23b61b07bf871 100644 --- a/x-pack/plugins/maps/public/layers/styles/color_utils.js +++ b/x-pack/plugins/maps/public/layers/styles/color_utils.js @@ -9,7 +9,7 @@ import tinycolor from 'tinycolor2'; import chroma from 'chroma-js'; import { euiPaletteColorBlind } from '@elastic/eui/lib/services'; import { ColorGradient } from './components/color_gradient'; -import { COLOR_PALETTE_MAX_SIZE } from '../../../../../legacy/plugins/maps/common/constants'; +import { COLOR_PALETTE_MAX_SIZE } from '../../../common/constants'; import { vislibColorMaps } from '../../../../../../src/plugins/charts/public'; const GRADIENT_INTERVALS = 8; diff --git a/x-pack/plugins/maps/public/layers/styles/heatmap/heatmap_style.js b/x-pack/plugins/maps/public/layers/styles/heatmap/heatmap_style.js index 35338d86ff767..d769fe0da9ec2 100644 --- a/x-pack/plugins/maps/public/layers/styles/heatmap/heatmap_style.js +++ b/x-pack/plugins/maps/public/layers/styles/heatmap/heatmap_style.js @@ -9,10 +9,7 @@ import { AbstractStyle } from '../abstract_style'; import { HeatmapStyleEditor } from './components/heatmap_style_editor'; import { HeatmapLegend } from './components/legend/heatmap_legend'; import { DEFAULT_HEATMAP_COLOR_RAMP_NAME } from './components/heatmap_constants'; -import { - LAYER_STYLE_TYPE, - GRID_RESOLUTION, -} from '../../../../../../legacy/plugins/maps/common/constants'; +import { LAYER_STYLE_TYPE, GRID_RESOLUTION } from '../../../../common/constants'; import { getOrdinalColorRampStops } from '../color_utils'; import { i18n } from '@kbn/i18n'; import { EuiIcon } from '@elastic/eui'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js b/x-pack/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js index c944f5e759165..bf57306df5697 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import { EuiSpacer, EuiSelect, EuiSuperSelect, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { ColorStopsOrdinal } from './color_stops_ordinal'; -import { COLOR_MAP_TYPE } from '../../../../../../../../legacy/plugins/maps/common/constants'; +import { COLOR_MAP_TYPE } from '../../../../../../common/constants'; import { ColorStopsCategorical } from './color_stops_categorical'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js index 836306651737b..5e8f720fcc5e3 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js @@ -9,10 +9,7 @@ import React, { Fragment } from 'react'; import { FieldSelect } from '../field_select'; import { ColorMapSelect } from './color_map_select'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { - CATEGORICAL_DATA_TYPES, - COLOR_MAP_TYPE, -} from '../../../../../../../../legacy/plugins/maps/common/constants'; +import { CATEGORICAL_DATA_TYPES, COLOR_MAP_TYPE } from '../../../../../../common/constants'; import { COLOR_GRADIENTS, COLOR_PALETTES } from '../../../color_utils'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx b/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx index 988b53c728c8f..550b3737963d5 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx @@ -11,7 +11,7 @@ import { EuiFormRow, EuiSwitch, EuiSwitchEvent } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FieldMetaPopover } from './field_meta_popover'; import { IDynamicStyleProperty } from '../../properties/dynamic_style_property'; -import { FieldMetaOptions } from '../../../../../../../../legacy/plugins/maps/common/descriptor_types'; +import { FieldMetaOptions } from '../../../../../../common/descriptor_types'; type Props = { styleProperty: IDynamicStyleProperty; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx b/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx index b4f04ed9cefe9..32a54a45ed4d7 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/field_meta/ordinal_field_meta_popover.tsx @@ -12,8 +12,8 @@ import { i18n } from '@kbn/i18n'; import { DEFAULT_SIGMA } from '../../vector_style_defaults'; import { FieldMetaPopover } from './field_meta_popover'; import { IDynamicStyleProperty } from '../../properties/dynamic_style_property'; -import { FieldMetaOptions } from '../../../../../../../../legacy/plugins/maps/common/descriptor_types'; -import { VECTOR_STYLES } from '../../../../../../../../legacy/plugins/maps/common/constants'; +import { FieldMetaOptions } from '../../../../../../common/descriptor_types'; +import { VECTOR_STYLES } from '../../../../../../common/constants'; function getIsEnableToggleLabel(styleName: string) { switch (styleName) { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/field_select.js b/x-pack/plugins/maps/public/layers/styles/vector/components/field_select.js index c4caece047019..ed2e7a4eab7ec 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/field_select.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/field_select.js @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import { EuiComboBox, EuiHighlight, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FIELD_ORIGIN } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { FIELD_ORIGIN } from '../../../../../common/constants'; import { i18n } from '@kbn/i18n'; import { FieldIcon } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js b/x-pack/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js index 5999dfa384003..5d39b423e56e6 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/get_vector_style_label.js @@ -6,7 +6,7 @@ import { i18n } from '@kbn/i18n'; -import { VECTOR_STYLES } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { VECTOR_STYLES } from '../../../../../common/constants'; export function getDisabledByMessage(styleName) { return i18n.translate('xpack.maps.styles.vector.disabledByMessage', { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js index 2a41c97ec0106..b3e3e028c9aeb 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/label/vector_style_label_border_size_editor.js @@ -9,10 +9,7 @@ import React from 'react'; import { EuiFormRow, EuiSelect, EuiToolTip } from '@elastic/eui'; import { getVectorStyleLabel, getDisabledByMessage } from '../get_vector_style_label'; import { i18n } from '@kbn/i18n'; -import { - LABEL_BORDER_SIZES, - VECTOR_STYLES, -} from '../../../../../../../../legacy/plugins/maps/common/constants'; +import { LABEL_BORDER_SIZES, VECTOR_STYLES } from '../../../../../../common/constants'; const options = [ { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/legend/category.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/category.js index 5fb91e77bfcfc..b0f397b6375ad 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/legend/category.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/category.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { VECTOR_STYLES } from '../../../../../../../../legacy/plugins/maps/common/constants'; +import { VECTOR_STYLES } from '../../../../../../common/constants'; import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import { VectorIcon } from './vector_icon'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js index 5df980a576795..66a93c7301318 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/legend/extract_color_from_style_property.js @@ -5,10 +5,7 @@ */ import { getColorRampCenterColor, getColorPalette } from '../../../color_utils'; -import { - COLOR_MAP_TYPE, - STYLE_TYPE, -} from '../../../../../../../../legacy/plugins/maps/common/constants'; +import { COLOR_MAP_TYPE, STYLE_TYPE } from '../../../../../../common/constants'; export function extractColorFromStyleProperty(colorStyleProperty, defaultColor) { if (!colorStyleProperty) { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js index 6c953274b1b4d..b28743f426262 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/orientation/static_orientation_form.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { ValidatedRange } from '../../../../../../../../legacy/plugins/maps/public/components/validated_range'; +import { ValidatedRange } from '../../../../../components/validated_range'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; export function StaticOrientationForm({ onStaticStyleChange, staticDynamicSelect, styleProperty }) { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js b/x-pack/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js index 1192b36cea029..90e540cc6802a 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/size/static_size_form.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { ValidatedRange } from '../../../../../../../../legacy/plugins/maps/public/components/validated_range'; +import { ValidatedRange } from '../../../../../components/validated_range'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js index 5215390edb382..005bc11aa1bd8 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/style_prop_editor.js @@ -14,7 +14,7 @@ import { EuiFieldText, EuiToolTip, } from '@elastic/eui'; -import { STYLE_TYPE } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { STYLE_TYPE } from '../../../../../common/constants'; import { i18n } from '@kbn/i18n'; export class StylePropEditor extends Component { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js index 41da29e6bb3f8..0da3074f55e49 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/icon_stops.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { DEFAULT_ICON } from '../../../../../../../../legacy/plugins/maps/common/constants'; +import { DEFAULT_ICON } from '../../../../../../common/constants'; import { i18n } from '@kbn/i18n'; import { getOtherCategoryLabel } from '../../style_util'; import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiFieldText } from '@elastic/eui'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js index 190fc05b9ddcc..36b6c1a76470c 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_icon_editor.js @@ -6,7 +6,7 @@ import React from 'react'; -import { getUiSettings } from '../../../../../../../../legacy/plugins/maps/public/kibana_services'; +import { getUiSettings } from '../../../../../kibana_services'; import { StylePropEditor } from '../style_prop_editor'; import { DynamicIconForm } from './dynamic_icon_form'; import { StaticIconForm } from './static_icon_form'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js index ef1e668a3802f..cf287e8b1fd5f 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/symbol/vector_style_symbolize_as_editor.js @@ -9,10 +9,7 @@ import React from 'react'; import { EuiFormRow, EuiButtonGroup, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { - SYMBOLIZE_AS_TYPES, - VECTOR_STYLES, -} from '../../../../../../../../legacy/plugins/maps/common/constants'; +import { SYMBOLIZE_AS_TYPES, VECTOR_STYLES } from '../../../../../../common/constants'; import { getDisabledByMessage } from '../get_vector_style_label'; const SYMBOLIZE_AS_OPTIONS = [ diff --git a/x-pack/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js b/x-pack/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js index e6b845b9d6cf6..6cece5efb3a5d 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js @@ -26,7 +26,7 @@ import { LABEL_BORDER_SIZES, VECTOR_STYLES, STYLE_TYPE, -} from '../../../../../../../legacy/plugins/maps/common/constants'; +} from '../../../../../common/constants'; export class VectorStyleEditor extends Component { state = { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js index 0c4d4218d57bd..146bc40aa8531 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js @@ -18,7 +18,7 @@ import { EuiTextColor, } from '@elastic/eui'; import { Category } from '../components/legend/category'; -import { COLOR_MAP_TYPE } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { COLOR_MAP_TYPE } from '../../../../../common/constants'; import { isCategoricalStopsInvalid } from '../components/color/color_stops_utils'; const EMPTY_STOPS = { stops: [], defaultColor: null }; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js index 8335b6382755c..b19c25b369848 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js @@ -16,11 +16,7 @@ import { shallow } from 'enzyme'; import { DynamicColorProperty } from './dynamic_color_property'; import { StyleMeta } from '../style_meta'; -import { - COLOR_MAP_TYPE, - FIELD_ORIGIN, - VECTOR_STYLES, -} from '../../../../../../../legacy/plugins/maps/common/constants'; +import { COLOR_MAP_TYPE, FIELD_ORIGIN, VECTOR_STYLES } from '../../../../../common/constants'; const mockField = { async getLabel() { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js index 441d5ddb8ceea..ae4d935e2457b 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_orientation_property.js @@ -6,7 +6,7 @@ import { DynamicStyleProperty } from './dynamic_style_property'; import { getComputedFieldName } from '../style_util'; -import { VECTOR_STYLES } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { VECTOR_STYLES } from '../../../../../common/constants'; export class DynamicOrientationProperty extends DynamicStyleProperty { syncIconRotationWithMb(symbolLayerId, mbMap) { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js index 0b256e75eeadf..8b3f670bfa528 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_size_property.js @@ -11,7 +11,7 @@ import { LARGE_MAKI_ICON_SIZE, SMALL_MAKI_ICON_SIZE, } from '../symbol_utils'; -import { VECTOR_STYLES } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { VECTOR_STYLES } from '../../../../../common/constants'; import _ from 'lodash'; import { CircleIcon } from '../components/legend/circle_icon'; import React, { Fragment } from 'react'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts index 6fd15eaaeda97..88eb489c4996e 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts @@ -6,13 +6,13 @@ /* eslint-disable @typescript-eslint/consistent-type-definitions */ import { IStyleProperty } from './style_property'; -import { FIELD_ORIGIN } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { FIELD_ORIGIN } from '../../../../../common/constants'; import { CategoryFieldMeta, DynamicStylePropertyOptions, FieldMetaOptions, RangeFieldMeta, -} from '../../../../../../../legacy/plugins/maps/common/descriptor_types'; +} from '../../../../../common/descriptor_types'; import { IField } from '../../../fields/field'; export interface IDynamicStyleProperty extends IStyleProperty { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js index 86fe89b0aae10..ea521f8749d80 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js @@ -12,7 +12,7 @@ import { STYLE_TYPE, SOURCE_META_ID_ORIGIN, FIELD_ORIGIN, -} from '../../../../../../../legacy/plugins/maps/common/constants'; +} from '../../../../../common/constants'; import React from 'react'; import { OrdinalLegend } from './components/ordinal_legend'; import { CategoricalLegend } from './components/categorical_legend'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js index bb0ce494be170..3016b15d0a05c 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/label_border_size_property.js @@ -7,7 +7,7 @@ import _ from 'lodash'; import { AbstractStyleProperty } from './style_property'; import { DEFAULT_LABEL_SIZE } from '../vector_style_defaults'; -import { LABEL_BORDER_SIZES } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { LABEL_BORDER_SIZES } from '../../../../../common/constants'; const SMALL_SIZE = 1 / 16; const MEDIUM_SIZE = 1 / 8; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/properties/static_style_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/static_style_property.js index 636c38ecb2667..a02aa15e28b28 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/properties/static_style_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/static_style_property.js @@ -5,7 +5,7 @@ */ import { AbstractStyleProperty } from './style_property'; -import { STYLE_TYPE } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { STYLE_TYPE } from '../../../../../common/constants'; export class StaticStyleProperty extends AbstractStyleProperty { static type = STYLE_TYPE.STATIC; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/properties/style_property.ts b/x-pack/plugins/maps/public/layers/styles/vector/properties/style_property.ts index 2d22c891afaa1..af04a95e3c3bd 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/properties/style_property.ts +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/style_property.ts @@ -8,11 +8,8 @@ import { ReactElement } from 'react'; // @ts-ignore import { getVectorStyleLabel } from '../components/get_vector_style_label'; -import { - FieldMetaOptions, - StylePropertyOptions, -} from '../../../../../../../legacy/plugins/maps/common/descriptor_types'; -import { VECTOR_STYLES } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { FieldMetaOptions, StylePropertyOptions } from '../../../../../common/descriptor_types'; +import { VECTOR_STYLES } from '../../../../../common/constants'; type LegendProps = { isPointsOnly: boolean; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js b/x-pack/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js index 9f24d81a9b6e1..9ae1ef5054e30 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/properties/symbolize_as_property.js @@ -5,7 +5,7 @@ */ import { AbstractStyleProperty } from './style_property'; -import { SYMBOLIZE_AS_TYPES } from '../../../../../../../legacy/plugins/maps/common/constants'; +import { SYMBOLIZE_AS_TYPES } from '../../../../../common/constants'; export class SymbolizeAsProperty extends AbstractStyleProperty { constructor(options, styleName) { diff --git a/x-pack/plugins/maps/public/layers/styles/vector/style_meta.ts b/x-pack/plugins/maps/public/layers/styles/vector/style_meta.ts index d130a9752b674..646b88d005af7 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/style_meta.ts +++ b/x-pack/plugins/maps/public/layers/styles/vector/style_meta.ts @@ -8,7 +8,7 @@ import { StyleMetaDescriptor, RangeFieldMeta, CategoryFieldMeta, -} from '../../../../../../legacy/plugins/maps/common/descriptor_types'; +} from '../../../../common/descriptor_types'; export class StyleMeta { private readonly _descriptor: StyleMetaDescriptor; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/symbol_utils.js b/x-pack/plugins/maps/public/layers/styles/vector/symbol_utils.js index d98673d63fc1e..c1c4375faaeb1 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/symbol_utils.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/symbol_utils.js @@ -7,7 +7,7 @@ import React from 'react'; import maki from '@elastic/maki'; import xml2js from 'xml2js'; -import { parseXmlString } from '../../../../../../legacy/plugins/maps/common/parse_xml_string'; +import { parseXmlString } from '../../../../common/parse_xml_string'; import { SymbolIcon } from './components/legend/symbol_icon'; export const LARGE_MAKI_ICON_SIZE = 15; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/vector_style.d.ts b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.d.ts index 6ed1c24cc5d09..77ea44ac26bf9 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/vector_style.d.ts +++ b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.d.ts @@ -7,7 +7,7 @@ import { IStyleProperty } from './properties/style_property'; import { IDynamicStyleProperty } from './properties/dynamic_style_property'; import { IVectorLayer } from '../../vector_layer'; import { IVectorSource } from '../../sources/vector_source'; -import { VectorStyleDescriptor } from '../../../../../../legacy/plugins/maps/common/descriptor_types'; +import { VectorStyleDescriptor } from '../../../../common/descriptor_types'; export interface IVectorStyle { getAllStyleProperties(): IStyleProperty[]; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/vector_style.js b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.js index db1a6341014f6..ae5d148e43cfd 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/vector_style.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.js @@ -17,7 +17,7 @@ import { LAYER_STYLE_TYPE, DEFAULT_ICON, VECTOR_STYLES, -} from '../../../../../../legacy/plugins/maps/common/constants'; +} from '../../../../common/constants'; import { StyleMeta } from './style_meta'; import { VectorIcon } from './components/legend/vector_icon'; import { VectorStyleLegend } from './components/legend/vector_style_legend'; diff --git a/x-pack/plugins/maps/public/layers/styles/vector/vector_style.test.js b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.test.js index b5e16223fc2ee..426f1d6afa952 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/vector_style.test.js +++ b/x-pack/plugins/maps/public/layers/styles/vector/vector_style.test.js @@ -7,7 +7,7 @@ import { VectorStyle } from './vector_style'; import { DataRequest } from '../../util/data_request'; import { VECTOR_SHAPE_TYPES } from '../../sources/vector_feature_types'; -import { FIELD_ORIGIN, STYLE_TYPE } from '../../../../../../legacy/plugins/maps/common/constants'; +import { FIELD_ORIGIN, STYLE_TYPE } from '../../../../common/constants'; jest.mock('../../../kibana_services'); jest.mock('ui/new_platform'); @@ -67,7 +67,7 @@ describe('getDescriptorWithMissingStylePropsRemoved', () => { }; beforeEach(() => { - require('../../../../../../legacy/plugins/maps/public/kibana_services').getUiSettings = () => ({ + require('../../../kibana_services').getUiSettings = () => ({ get: jest.fn(), }); }); diff --git a/x-pack/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts b/x-pack/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts index cf10af8470afe..86602381cf615 100644 --- a/x-pack/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts +++ b/x-pack/plugins/maps/public/layers/styles/vector/vector_style_defaults.ts @@ -10,7 +10,7 @@ import { SYMBOLIZE_AS_TYPES, VECTOR_STYLES, STYLE_TYPE, -} from '../../../../../../legacy/plugins/maps/common/constants'; +} from '../../../../common/constants'; import { COLOR_GRADIENTS, COLOR_PALETTES, @@ -18,9 +18,9 @@ import { DEFAULT_LINE_COLORS, // @ts-ignore } from '../color_utils'; -import { VectorStylePropertiesDescriptor } from '../../../../../../legacy/plugins/maps/common/descriptor_types'; +import { VectorStylePropertiesDescriptor } from '../../../../common/descriptor_types'; // @ts-ignore -import { getUiSettings } from '../../../../../../legacy/plugins/maps/public/kibana_services'; +import { getUiSettings } from '../../../kibana_services'; export const MIN_SIZE = 1; export const MAX_SIZE = 64; diff --git a/x-pack/plugins/maps/public/layers/tile_layer.d.ts b/x-pack/plugins/maps/public/layers/tile_layer.d.ts index a36f7a53cc905..53e8c388ee4c2 100644 --- a/x-pack/plugins/maps/public/layers/tile_layer.d.ts +++ b/x-pack/plugins/maps/public/layers/tile_layer.d.ts @@ -6,7 +6,7 @@ import { AbstractLayer, ILayerArguments } from './layer'; import { ITMSSource } from './sources/tms_source'; -import { LayerDescriptor } from '../../../../legacy/plugins/maps/common/descriptor_types'; +import { LayerDescriptor } from '../../common/descriptor_types'; interface ITileLayerArguments extends ILayerArguments { source: ITMSSource; diff --git a/x-pack/plugins/maps/public/layers/tile_layer.js b/x-pack/plugins/maps/public/layers/tile_layer.js index bd27f60125927..aa2619e96f834 100644 --- a/x-pack/plugins/maps/public/layers/tile_layer.js +++ b/x-pack/plugins/maps/public/layers/tile_layer.js @@ -6,10 +6,7 @@ import { AbstractLayer } from './layer'; import _ from 'lodash'; -import { - SOURCE_DATA_ID_ORIGIN, - LAYER_TYPE, -} from '../../../../legacy/plugins/maps/common/constants'; +import { SOURCE_DATA_ID_ORIGIN, LAYER_TYPE } from '../../common/constants'; export class TileLayer extends AbstractLayer { static type = LAYER_TYPE.TILE; diff --git a/x-pack/plugins/maps/public/layers/tile_layer.test.ts b/x-pack/plugins/maps/public/layers/tile_layer.test.ts index a5087041b826c..1cb99dcbc1a70 100644 --- a/x-pack/plugins/maps/public/layers/tile_layer.test.ts +++ b/x-pack/plugins/maps/public/layers/tile_layer.test.ts @@ -5,8 +5,8 @@ */ import { TileLayer } from './tile_layer'; -import { EMS_XYZ } from '../../../../legacy/plugins/maps/common/constants'; -import { XYZTMSSourceDescriptor } from '../../../../legacy/plugins/maps/common/descriptor_types'; +import { EMS_XYZ } from '../../common/constants'; +import { XYZTMSSourceDescriptor } from '../../common/descriptor_types'; import { ITMSSource, AbstractTMSSource } from './sources/tms_source'; import { ILayer } from './layer'; diff --git a/x-pack/plugins/maps/public/layers/util/assign_feature_ids.test.ts b/x-pack/plugins/maps/public/layers/util/assign_feature_ids.test.ts index 7d6dbb5c8a2fe..fb07a523e1e07 100644 --- a/x-pack/plugins/maps/public/layers/util/assign_feature_ids.test.ts +++ b/x-pack/plugins/maps/public/layers/util/assign_feature_ids.test.ts @@ -5,7 +5,7 @@ */ import { assignFeatureIds } from './assign_feature_ids'; -import { FEATURE_ID_PROPERTY_NAME } from '../../../../../legacy/plugins/maps/common/constants'; +import { FEATURE_ID_PROPERTY_NAME } from '../../../common/constants'; import { FeatureCollection, Feature, Point } from 'geojson'; const featureId = 'myFeature1'; diff --git a/x-pack/plugins/maps/public/layers/util/assign_feature_ids.ts b/x-pack/plugins/maps/public/layers/util/assign_feature_ids.ts index aeb04f546bdf1..e5c170a803174 100644 --- a/x-pack/plugins/maps/public/layers/util/assign_feature_ids.ts +++ b/x-pack/plugins/maps/public/layers/util/assign_feature_ids.ts @@ -6,7 +6,7 @@ import _ from 'lodash'; import { FeatureCollection, Feature } from 'geojson'; -import { FEATURE_ID_PROPERTY_NAME } from '../../../../../legacy/plugins/maps/common/constants'; +import { FEATURE_ID_PROPERTY_NAME } from '../../../common/constants'; let idCounter = 0; diff --git a/x-pack/plugins/maps/public/layers/util/can_skip_fetch.ts b/x-pack/plugins/maps/public/layers/util/can_skip_fetch.ts index 4b13c48f5b699..758cc35f41fbb 100644 --- a/x-pack/plugins/maps/public/layers/util/can_skip_fetch.ts +++ b/x-pack/plugins/maps/public/layers/util/can_skip_fetch.ts @@ -9,7 +9,7 @@ import turf from 'turf'; import turfBooleanContains from '@turf/boolean-contains'; import { isRefreshOnlyQuery } from './is_refresh_only_query'; import { ISource } from '../sources/source'; -import { DataMeta } from '../../../../../legacy/plugins/maps/common/descriptor_types'; +import { DataMeta } from '../../../common/descriptor_types'; import { DataRequest } from './data_request'; const SOURCE_UPDATE_REQUIRED = true; diff --git a/x-pack/plugins/maps/public/layers/util/data_request.ts b/x-pack/plugins/maps/public/layers/util/data_request.ts index fe505b6596d87..eeef5c49c6ef8 100644 --- a/x-pack/plugins/maps/public/layers/util/data_request.ts +++ b/x-pack/plugins/maps/public/layers/util/data_request.ts @@ -6,10 +6,7 @@ /* eslint-disable max-classes-per-file */ import _ from 'lodash'; -import { - DataRequestDescriptor, - DataMeta, -} from '../../../../../legacy/plugins/maps/common/descriptor_types'; +import { DataRequestDescriptor, DataMeta } from '../../../common/descriptor_types'; export class DataRequest { private readonly _descriptor: DataRequestDescriptor; diff --git a/x-pack/plugins/maps/public/layers/util/es_agg_utils.ts b/x-pack/plugins/maps/public/layers/util/es_agg_utils.ts index 878da180822ee..329a2a6fc64fb 100644 --- a/x-pack/plugins/maps/public/layers/util/es_agg_utils.ts +++ b/x-pack/plugins/maps/public/layers/util/es_agg_utils.ts @@ -6,7 +6,7 @@ import { i18n } from '@kbn/i18n'; import _ from 'lodash'; import { IndexPattern, IFieldType } from '../../../../../../src/plugins/data/public'; -import { TOP_TERM_PERCENTAGE_SUFFIX } from '../../../../../legacy/plugins/maps/common/constants'; +import { TOP_TERM_PERCENTAGE_SUFFIX } from '../../../common/constants'; export function getField(indexPattern: IndexPattern, fieldName: string) { const field = indexPattern.fields.getByName(fieldName); diff --git a/x-pack/plugins/maps/public/layers/util/is_metric_countable.ts b/x-pack/plugins/maps/public/layers/util/is_metric_countable.ts index 505d57e47007e..37916e53d6c45 100644 --- a/x-pack/plugins/maps/public/layers/util/is_metric_countable.ts +++ b/x-pack/plugins/maps/public/layers/util/is_metric_countable.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AGG_TYPE } from '../../../../../legacy/plugins/maps/common/constants'; +import { AGG_TYPE } from '../../../common/constants'; export function isMetricCountable(aggType: AGG_TYPE): boolean { return [AGG_TYPE.COUNT, AGG_TYPE.SUM, AGG_TYPE.UNIQUE_COUNT].includes(aggType); diff --git a/x-pack/plugins/maps/public/layers/util/mb_filter_expressions.ts b/x-pack/plugins/maps/public/layers/util/mb_filter_expressions.ts index cf315d82d8b87..8da6fa2318de9 100644 --- a/x-pack/plugins/maps/public/layers/util/mb_filter_expressions.ts +++ b/x-pack/plugins/maps/public/layers/util/mb_filter_expressions.ts @@ -4,10 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - GEO_JSON_TYPE, - FEATURE_VISIBLE_PROPERTY_NAME, -} from '../../../../../legacy/plugins/maps/common/constants'; +import { GEO_JSON_TYPE, FEATURE_VISIBLE_PROPERTY_NAME } from '../../../common/constants'; const VISIBILITY_FILTER_CLAUSE = ['all', ['==', ['get', FEATURE_VISIBLE_PROPERTY_NAME], true]]; diff --git a/x-pack/plugins/maps/public/layers/vector_layer.d.ts b/x-pack/plugins/maps/public/layers/vector_layer.d.ts index ae26d48d69f38..65533621bcbd7 100644 --- a/x-pack/plugins/maps/public/layers/vector_layer.d.ts +++ b/x-pack/plugins/maps/public/layers/vector_layer.d.ts @@ -11,7 +11,7 @@ import { MapFilters, VectorLayerDescriptor, VectorSourceRequestMeta, -} from '../../../../legacy/plugins/maps/common/descriptor_types'; +} from '../../common/descriptor_types'; import { ILayer } from './layer'; import { IJoin } from './joins/join'; import { IVectorStyle } from './styles/vector/vector_style'; diff --git a/x-pack/plugins/maps/public/layers/vector_layer.js b/x-pack/plugins/maps/public/layers/vector_layer.js index 8deaca1c331f4..6b89554546330 100644 --- a/x-pack/plugins/maps/public/layers/vector_layer.js +++ b/x-pack/plugins/maps/public/layers/vector_layer.js @@ -18,7 +18,7 @@ import { LAYER_TYPE, FIELD_ORIGIN, LAYER_STYLE_TYPE, -} from '../../../../legacy/plugins/maps/common/constants'; +} from '../../common/constants'; import _ from 'lodash'; import { JoinTooltipProperty } from './tooltips/join_tooltip_property'; import { EuiIcon } from '@elastic/eui'; diff --git a/x-pack/plugins/maps/public/layers/vector_tile_layer.js b/x-pack/plugins/maps/public/layers/vector_tile_layer.js index d4f224e66c51d..44987fd3e78f0 100644 --- a/x-pack/plugins/maps/public/layers/vector_tile_layer.js +++ b/x-pack/plugins/maps/public/layers/vector_tile_layer.js @@ -6,15 +6,12 @@ import { TileLayer } from './tile_layer'; import _ from 'lodash'; -import { - SOURCE_DATA_ID_ORIGIN, - LAYER_TYPE, -} from '../../../../legacy/plugins/maps/common/constants'; -import { isRetina } from '../../../../legacy/plugins/maps/public/meta'; +import { SOURCE_DATA_ID_ORIGIN, LAYER_TYPE } from '../../common/constants'; +import { isRetina } from '../meta'; import { addSpriteSheetToMapFromImageData, loadSpriteSheetImageData, -} from '../../../../legacy/plugins/maps/public/connected_components/map/mb/utils'; //todo move this implementation +} from '../connected_components/map/mb/utils'; //todo move this implementation const MB_STYLE_TYPE_TO_OPACITY = { fill: ['fill-opacity'], diff --git a/x-pack/legacy/plugins/maps/public/meta.js b/x-pack/plugins/maps/public/meta.js similarity index 76% rename from x-pack/legacy/plugins/maps/public/meta.js rename to x-pack/plugins/maps/public/meta.js index 4d81785ff7a0a..d4612554cf00b 100644 --- a/x-pack/legacy/plugins/maps/public/meta.js +++ b/x-pack/plugins/maps/public/meta.js @@ -11,20 +11,19 @@ import { EMS_GLYPHS_PATH, EMS_APP_NAME, } from '../common/constants'; -import chrome from 'ui/chrome'; import { i18n } from '@kbn/i18n'; import { EMSClient } from '@elastic/ems-client'; -import { getLicenseId } from './kibana_services'; +import { getInjectedVarFunc, getLicenseId } from './kibana_services'; import fetch from 'node-fetch'; const GIS_API_RELATIVE = `../${GIS_API_PATH}`; export function getKibanaRegionList() { - return chrome.getInjected('regionmapLayers'); + return getInjectedVarFunc()('regionmapLayers'); } export function getKibanaTileMap() { - return chrome.getInjected('tilemap'); + return getInjectedVarFunc()('tilemap'); } function relativeToAbsolute(url) { @@ -41,27 +40,27 @@ let emsClient = null; let latestLicenseId = null; export function getEMSClient() { if (!emsClient) { - const isEmsEnabled = chrome.getInjected('isEmsEnabled', true); + const isEmsEnabled = getInjectedVarFunc()('isEmsEnabled', true); if (isEmsEnabled) { - const proxyElasticMapsServiceInMaps = chrome.getInjected( + const proxyElasticMapsServiceInMaps = getInjectedVarFunc()( 'proxyElasticMapsServiceInMaps', false ); const proxyPath = ''; const tileApiUrl = proxyElasticMapsServiceInMaps ? relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_TILES_CATALOGUE_PATH}`) - : chrome.getInjected('emsTileApiUrl'); + : getInjectedVarFunc()('emsTileApiUrl'); const fileApiUrl = proxyElasticMapsServiceInMaps ? relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_FILES_CATALOGUE_PATH}`) - : chrome.getInjected('emsFileApiUrl'); + : getInjectedVarFunc()('emsFileApiUrl'); emsClient = new EMSClient({ language: i18n.getLocale(), - appVersion: chrome.getInjected('kbnPkgVersion'), + appVersion: getInjectedVarFunc()('kbnPkgVersion'), appName: EMS_APP_NAME, tileApiUrl, fileApiUrl, - landingPageUrl: chrome.getInjected('emsLandingPageUrl'), + landingPageUrl: getInjectedVarFunc()('emsLandingPageUrl'), fetchFunction: fetchFunction, //import this from client-side, so the right instance is returned (bootstrapped from common/* would not work proxyPath, }); @@ -87,13 +86,13 @@ export function getEMSClient() { } export function getGlyphUrl() { - if (!chrome.getInjected('isEmsEnabled', true)) { + if (!getInjectedVarFunc()('isEmsEnabled', true)) { return ''; } - return chrome.getInjected('proxyElasticMapsServiceInMaps', false) + return getInjectedVarFunc()('proxyElasticMapsServiceInMaps', false) ? relativeToAbsolute(`../${GIS_API_PATH}/${EMS_TILES_CATALOGUE_PATH}/${EMS_GLYPHS_PATH}`) + `/{fontstack}/{range}` - : chrome.getInjected('emsFontLibraryUrl', true); + : getInjectedVarFunc()('emsFontLibraryUrl', true); } export function isRetina() { diff --git a/x-pack/legacy/plugins/maps/public/meta.test.js b/x-pack/plugins/maps/public/meta.test.js similarity index 100% rename from x-pack/legacy/plugins/maps/public/meta.test.js rename to x-pack/plugins/maps/public/meta.test.js From 8baff9ab0136ee12351bf2666f8116f518995010 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Wed, 1 Apr 2020 12:08:29 -0600 Subject: [PATCH 06/14] More moves of related files and clean-up of legacy refs --- .../plugins/maps/public/actions/map_actions.d.ts | 5 +++-- .../maps/public/connected_components/layer_panel/view.d.ts | 0 x-pack/plugins/maps/public/plugin.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) rename x-pack/{legacy => }/plugins/maps/public/actions/map_actions.d.ts (93%) rename x-pack/{legacy => }/plugins/maps/public/connected_components/layer_panel/view.d.ts (100%) diff --git a/x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts b/x-pack/plugins/maps/public/actions/map_actions.d.ts similarity index 93% rename from x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts rename to x-pack/plugins/maps/public/actions/map_actions.d.ts index b4a8ff90c3512..debead3ad5c45 100644 --- a/x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts +++ b/x-pack/plugins/maps/public/actions/map_actions.d.ts @@ -8,11 +8,12 @@ import { Filter, Query, TimeRange } from 'src/plugins/data/public'; import { AnyAction } from 'redux'; import { LAYER_TYPE } from '../../common/constants'; -import { DataMeta, MapFilters } from '../../common/descriptor_types'; import { + DataMeta, + MapFilters, MapCenterAndZoom, MapRefreshConfig, -} from '../../../../../plugins/maps/common/descriptor_types'; +} from '../../common/descriptor_types'; export type SyncContext = { startLoading(dataId: string, requestToken: symbol, meta: DataMeta): void; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/view.d.ts b/x-pack/plugins/maps/public/connected_components/layer_panel/view.d.ts similarity index 100% rename from x-pack/legacy/plugins/maps/public/connected_components/layer_panel/view.d.ts rename to x-pack/plugins/maps/public/connected_components/layer_panel/view.d.ts diff --git a/x-pack/plugins/maps/public/plugin.ts b/x-pack/plugins/maps/public/plugin.ts index 9b44a38175d16..cd8d955ba78ba 100644 --- a/x-pack/plugins/maps/public/plugin.ts +++ b/x-pack/plugins/maps/public/plugin.ts @@ -20,7 +20,7 @@ import { setTimeFilter, setToasts, setUiSettings, -} from '../../../legacy/plugins/maps/public/kibana_services'; +} from './kibana_services'; export interface MapsPluginSetupDependencies { inspector: InspectorSetupContract; From de14e51d4c0642e3eb30a32a88d6d50f690e22bc Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Wed, 1 Apr 2020 13:48:57 -0600 Subject: [PATCH 07/14] Path updates. Typescript warning fixes --- .../legacy/plugins/maps/public/actions/map_actions.d.ts | 8 ++++++++ .../public/connected_components/layer_panel/view.d.ts | 8 ++++++++ x-pack/plugins/maps/public/layers/blended_vector_layer.ts | 2 +- x-pack/plugins/maps/public/layers/layer.d.ts | 2 +- .../layers/sources/es_search_source/scaling_form.tsx | 2 +- x-pack/plugins/maps/public/layers/vector_layer.d.ts | 2 +- x-pack/plugins/maps/public/plugin.ts | 2 +- 7 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts create mode 100644 x-pack/legacy/plugins/maps/public/connected_components/layer_panel/view.d.ts diff --git a/x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts b/x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts new file mode 100644 index 0000000000000..34f8c30b51874 --- /dev/null +++ b/x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +/* eslint-disable @typescript-eslint/consistent-type-definitions */ + +export * from '../../../../../plugins/maps/public/actions/map_actions'; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/view.d.ts b/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/view.d.ts new file mode 100644 index 0000000000000..cf4fdc7be70c6 --- /dev/null +++ b/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/view.d.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +/* eslint-disable @typescript-eslint/consistent-type-definitions */ + +export * from '../../../../../../plugins/maps/public/connected_components/layer_panel/view'; diff --git a/x-pack/plugins/maps/public/layers/blended_vector_layer.ts b/x-pack/plugins/maps/public/layers/blended_vector_layer.ts index 0b080f5ef8df2..f5526ad703dd2 100644 --- a/x-pack/plugins/maps/public/layers/blended_vector_layer.ts +++ b/x-pack/plugins/maps/public/layers/blended_vector_layer.ts @@ -28,7 +28,7 @@ import { IVectorLayer, VectorLayerArguments } from './vector_layer'; import { IESSource } from './sources/es_source'; import { IESAggSource } from './sources/es_agg_source'; import { ISource } from './sources/source'; -import { SyncContext } from '../../../../legacy/plugins/maps/public/actions/map_actions'; +import { SyncContext } from '../actions/map_actions'; import { DataRequestAbortError } from './util/data_request'; import { VectorStyleDescriptor, diff --git a/x-pack/plugins/maps/public/layers/layer.d.ts b/x-pack/plugins/maps/public/layers/layer.d.ts index 7b37e16fb37ee..777566298e607 100644 --- a/x-pack/plugins/maps/public/layers/layer.d.ts +++ b/x-pack/plugins/maps/public/layers/layer.d.ts @@ -6,7 +6,7 @@ import { LayerDescriptor } from '../../common/descriptor_types'; import { ISource } from './sources/source'; import { DataRequest } from './util/data_request'; -import { SyncContext } from '../../../../legacy/plugins/maps/public/actions/map_actions'; +import { SyncContext } from '../actions/map_actions'; export interface ILayer { getDataRequest(id: string): DataRequest | undefined; diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx index b03a733f2164e..d86fc6d4026e6 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/scaling_form.tsx @@ -32,7 +32,7 @@ import { // @ts-ignore import { loadIndexSettings } from './load_index_settings'; import { IFieldType } from '../../../../../../../src/plugins/data/public'; -import { OnSourceChangeArgs } from '../../../../../../legacy/plugins/maps/public/connected_components/layer_panel/view'; +import { OnSourceChangeArgs } from '../../../connected_components/layer_panel/view'; interface Props { filterByMapBounds: boolean; diff --git a/x-pack/plugins/maps/public/layers/vector_layer.d.ts b/x-pack/plugins/maps/public/layers/vector_layer.d.ts index 65533621bcbd7..70fd9927b7732 100644 --- a/x-pack/plugins/maps/public/layers/vector_layer.d.ts +++ b/x-pack/plugins/maps/public/layers/vector_layer.d.ts @@ -16,7 +16,7 @@ import { ILayer } from './layer'; import { IJoin } from './joins/join'; import { IVectorStyle } from './styles/vector/vector_style'; import { IField } from './fields/field'; -import { SyncContext } from '../../../../legacy/plugins/maps/public/actions/map_actions'; +import { SyncContext } from '../actions/map_actions'; type VectorLayerArguments = { source: IVectorSource; diff --git a/x-pack/plugins/maps/public/plugin.ts b/x-pack/plugins/maps/public/plugin.ts index cd8d955ba78ba..9437c2512ded4 100644 --- a/x-pack/plugins/maps/public/plugin.ts +++ b/x-pack/plugins/maps/public/plugin.ts @@ -20,6 +20,7 @@ import { setTimeFilter, setToasts, setUiSettings, + // @ts-ignore } from './kibana_services'; export interface MapsPluginSetupDependencies { @@ -38,7 +39,6 @@ export const bindSetupCoreAndPlugins = (core: CoreSetup, plugins: any) => { setHttp(http); setUiSettings(core.uiSettings); setInjectedVarFunc(core.injectedMetadata.getInjectedVar); - npSetInjectedVarFunc(core.injectedMetadata.getInjectedVar); setToasts(core.notifications.toasts); }; From 9a3e560b6372c8b3981d44017a66b38cf043e002 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Wed, 1 Apr 2020 14:44:56 -0600 Subject: [PATCH 08/14] Update test paths --- .../maps/public/angular/get_initial_layers.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.test.js b/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.test.js index f41ed26b2a05d..5334beaaf714a 100644 --- a/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.test.js +++ b/x-pack/legacy/plugins/maps/public/angular/get_initial_layers.test.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -jest.mock('../meta', () => { +jest.mock('../../../../../plugins/maps/public/meta', () => { return {}; }); jest.mock('../kibana_services'); @@ -32,7 +32,7 @@ describe('Saved object has layer list', () => { describe('kibana.yml configured with map.tilemap.url', () => { beforeAll(() => { - require('../meta').getKibanaTileMap = () => { + require('../../../../../plugins/maps/public/meta').getKibanaTileMap = () => { return { url: 'myTileUrl', }; @@ -62,7 +62,7 @@ describe('kibana.yml configured with map.tilemap.url', () => { describe('EMS is enabled', () => { beforeAll(() => { - require('../meta').getKibanaTileMap = () => { + require('../../../../../plugins/maps/public/meta').getKibanaTileMap = () => { return null; }; require('../kibana_services').getInjectedVarFunc = () => key => { @@ -106,7 +106,7 @@ describe('EMS is enabled', () => { describe('EMS is not enabled', () => { beforeAll(() => { - require('../meta').getKibanaTileMap = () => { + require('../../../../../plugins/maps/public/meta').getKibanaTileMap = () => { return null; }; From 51830aaaf60963fccf020899c8978ab01864d047 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Wed, 1 Apr 2020 14:45:44 -0600 Subject: [PATCH 09/14] Clean up unused kibana services usage in legacy --- .../plugins/maps/public/kibana_services.js | 62 ------------------- x-pack/legacy/plugins/maps/public/plugin.ts | 17 +---- 2 files changed, 1 insertion(+), 78 deletions(-) diff --git a/x-pack/legacy/plugins/maps/public/kibana_services.js b/x-pack/legacy/plugins/maps/public/kibana_services.js index 3b0f501dc0f60..a6491fe1aa6d4 100644 --- a/x-pack/legacy/plugins/maps/public/kibana_services.js +++ b/x-pack/legacy/plugins/maps/public/kibana_services.js @@ -4,88 +4,26 @@ * you may not use this file except in compliance with the Elastic License. */ -import { esFilters, search } from '../../../../../src/plugins/data/public'; -const { getRequestInspectorStats, getResponseInspectorStats } = search; - -export const SPATIAL_FILTER_TYPE = esFilters.FILTERS.SPATIAL_FILTER; -export { SearchSource } from '../../../../../src/plugins/data/public'; - let indexPatternService; export const setIndexPatternService = dataIndexPatterns => (indexPatternService = dataIndexPatterns); export const getIndexPatternService = () => indexPatternService; -let autocompleteService; -export const setAutocompleteService = dataAutoComplete => (autocompleteService = dataAutoComplete); -export const getAutocompleteService = () => autocompleteService; - -let licenseId; -export const setLicenseId = latestLicenseId => (licenseId = latestLicenseId); -export const getLicenseId = () => { - return licenseId; -}; - let inspector; export const setInspector = newInspector => (inspector = newInspector); export const getInspector = () => { return inspector; }; -let fileUploadPlugin; -export const setFileUpload = fileUpload => (fileUploadPlugin = fileUpload); -export const getFileUploadComponent = () => { - return fileUploadPlugin.JsonUploadAndParse; -}; - let getInjectedVar; export const setInjectedVarFunc = getInjectedVarFunc => (getInjectedVar = getInjectedVarFunc); export const getInjectedVarFunc = () => getInjectedVar; -let uiSettings; -export const setUiSettings = coreUiSettings => (uiSettings = coreUiSettings); -export const getUiSettings = () => uiSettings; - let indexPatternSelectComponent; export const setIndexPatternSelect = indexPatternSelect => (indexPatternSelectComponent = indexPatternSelect); export const getIndexPatternSelectComponent = () => indexPatternSelectComponent; -let coreHttp; -export const setHttp = http => (coreHttp = http); -export const getHttp = () => coreHttp; - let dataTimeFilter; export const setTimeFilter = timeFilter => (dataTimeFilter = timeFilter); export const getTimeFilter = () => dataTimeFilter; - -let toast; -export const setToasts = notificationToast => (toast = notificationToast); -export const getToasts = () => toast; - -export async function fetchSearchSourceAndRecordWithInspector({ - searchSource, - requestId, - requestName, - requestDesc, - inspectorAdapters, - abortSignal, -}) { - const inspectorRequest = inspectorAdapters.requests.start(requestName, { - id: requestId, - description: requestDesc, - }); - let resp; - try { - inspectorRequest.stats(getRequestInspectorStats(searchSource)); - searchSource.getSearchRequestBody().then(body => { - inspectorRequest.json(body); - }); - resp = await searchSource.fetch({ abortSignal }); - inspectorRequest.stats(getResponseInspectorStats(searchSource, resp)).ok({ json: resp }); - } catch (error) { - inspectorRequest.error({ error }); - throw error; - } - - return resp; -} diff --git a/x-pack/legacy/plugins/maps/public/plugin.ts b/x-pack/legacy/plugins/maps/public/plugin.ts index e6e5d67a3611d..e0a2797e49426 100644 --- a/x-pack/legacy/plugins/maps/public/plugin.ts +++ b/x-pack/legacy/plugins/maps/public/plugin.ts @@ -13,17 +13,11 @@ import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import { MapListing } from './components/map_listing'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { - setLicenseId, setInspector, - setFileUpload, setIndexPatternSelect, - setHttp, setTimeFilter, - setUiSettings, setInjectedVarFunc, - setToasts, setIndexPatternService, - setAutocompleteService, } from './kibana_services'; // @ts-ignore import { @@ -62,26 +56,17 @@ interface MapsPluginStartDependencies { } export const bindSetupCoreAndPlugins = (core: CoreSetup, plugins: any) => { - const { licensing } = plugins; const { injectedMetadata, http } = core; - if (licensing) { - licensing.license$.subscribe(({ uid }: { uid: string }) => setLicenseId(uid)); - } setInjectedVarFunc(injectedMetadata.getInjectedVar); - setHttp(http); - setUiSettings(core.uiSettings); setInjectedVarFunc(core.injectedMetadata.getInjectedVar); - setToasts(core.notifications.toasts); }; export const bindStartCoreAndPlugins = (core: CoreStart, plugins: any) => { - const { file_upload, data, inspector } = plugins; + const { data, inspector } = plugins; setInspector(inspector); - setFileUpload(file_upload); setIndexPatternSelect(data.ui.IndexPatternSelect); setTimeFilter(data.query.timefilter.timefilter); setIndexPatternService(data.indexPatterns); - setAutocompleteService(data.autocomplete); }; /** @internal */ From 37f8f0fdbe12193c09970635dcd25c49ed23f1ed Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Wed, 1 Apr 2020 15:42:34 -0600 Subject: [PATCH 10/14] Remove unused http ref --- x-pack/legacy/plugins/maps/public/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/maps/public/plugin.ts b/x-pack/legacy/plugins/maps/public/plugin.ts index e0a2797e49426..8b49f81a129ed 100644 --- a/x-pack/legacy/plugins/maps/public/plugin.ts +++ b/x-pack/legacy/plugins/maps/public/plugin.ts @@ -56,7 +56,7 @@ interface MapsPluginStartDependencies { } export const bindSetupCoreAndPlugins = (core: CoreSetup, plugins: any) => { - const { injectedMetadata, http } = core; + const { injectedMetadata } = core; setInjectedVarFunc(injectedMetadata.getInjectedVar); setInjectedVarFunc(core.injectedMetadata.getInjectedVar); }; From 7fe2f635ccb1a8cc5886351008473c783cfefff8 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Fri, 3 Apr 2020 11:26:44 -0600 Subject: [PATCH 11/14] Test fixes and clean up --- .../source_select/source_select.js | 3 +- .../resources/metrics_expression.test.js | 2 +- x-pack/legacy/plugins/maps/public/plugin.ts | 9 +- .../maps/public/selectors/map_selectors.js | 3 +- .../public/selectors/map_selectors.test.js | 10 +- .../add_tooltip_field_popover.test.js.snap | 159 ++++++++++++++++++ .../tooltip_selector.test.js.snap | 49 ++++++ .../validated_range.test.js.snap | 72 ++++++++ x-pack/plugins/maps/public/meta.test.js | 45 ++--- 9 files changed, 311 insertions(+), 41 deletions(-) create mode 100644 x-pack/plugins/maps/public/components/__snapshots__/add_tooltip_field_popover.test.js.snap create mode 100644 x-pack/plugins/maps/public/components/__snapshots__/tooltip_selector.test.js.snap create mode 100644 x-pack/plugins/maps/public/components/__snapshots__/validated_range.test.js.snap diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_select/source_select.js b/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_select/source_select.js index b34a432bec88c..67cc17ebaa224 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_select/source_select.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/layer_addpanel/source_select/source_select.js @@ -5,7 +5,8 @@ */ import React, { Fragment } from 'react'; -import { getLayerWizards } from '../../../layers/layer_wizard_registry'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { getLayerWizards } from '../../../../../../../plugins/maps/public/layers/layer_wizard_registry'; import { EuiTitle, EuiSpacer, EuiCard, EuiIcon } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import _ from 'lodash'; diff --git a/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/metrics_expression.test.js b/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/metrics_expression.test.js index e4e3776c8e92c..d8bf862249448 100644 --- a/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/metrics_expression.test.js +++ b/x-pack/legacy/plugins/maps/public/connected_components/layer_panel/join_editor/resources/metrics_expression.test.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -jest.mock('../../../../components/metrics_editor', () => ({ +jest.mock('../../../../../../../../plugins/maps/public/components/metric_editor', () => ({ MetricsEditor: () => { return
mockMetricsEditor
; }, diff --git a/x-pack/legacy/plugins/maps/public/plugin.ts b/x-pack/legacy/plugins/maps/public/plugin.ts index 696ec73400df5..0fa7e1106a6df 100644 --- a/x-pack/legacy/plugins/maps/public/plugin.ts +++ b/x-pack/legacy/plugins/maps/public/plugin.ts @@ -4,9 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import './layers/layer_wizard_registry'; -import './layers/sources/source_registry'; -import './layers/load_layer_wizards'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import '../../../../plugins/maps/public/layers/layer_wizard_registry'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import '../../../../plugins/maps/public/layers/sources/source_registry'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import '../../../../plugins/maps/public/layers/load_layer_wizards'; import { Plugin, CoreStart, CoreSetup } from 'src/core/public'; // @ts-ignore diff --git a/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js b/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js index fe90a179cb1d4..59346e4c6fb98 100644 --- a/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js +++ b/x-pack/legacy/plugins/maps/public/selectors/map_selectors.js @@ -26,7 +26,8 @@ import { } from '../../../../../plugins/maps/public/reducers/util'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { InnerJoin } from '../../../../../plugins/maps/public/layers/joins/inner_join'; -import { getSourceByType } from '../layers/sources/source_registry'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { getSourceByType } from '../../../../../plugins/maps/public/layers/sources/source_registry'; function createLayerInstance(layerDescriptor, inspectorAdapters) { const source = createSourceInstance(layerDescriptor.sourceDescriptor, inspectorAdapters); diff --git a/x-pack/legacy/plugins/maps/public/selectors/map_selectors.test.js b/x-pack/legacy/plugins/maps/public/selectors/map_selectors.test.js index 1a5ab633a569f..77bd29259647c 100644 --- a/x-pack/legacy/plugins/maps/public/selectors/map_selectors.test.js +++ b/x-pack/legacy/plugins/maps/public/selectors/map_selectors.test.js @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -jest.mock('../layers/vector_layer', () => {}); -jest.mock('../layers/blended_vector_layer', () => {}); -jest.mock('../layers/heatmap_layer', () => {}); -jest.mock('../layers/vector_tile_layer', () => {}); -jest.mock('../layers/joins/inner_join', () => {}); +jest.mock('../../../../../plugins/maps/public/layers/vector_layer', () => {}); +jest.mock('../../../../../plugins/maps/public/layers/blended_vector_layer', () => {}); +jest.mock('../../../../../plugins/maps/public/layers/heatmap_layer', () => {}); +jest.mock('../../../../../plugins/maps/public/layers/vector_tile_layer', () => {}); +jest.mock('../../../../../plugins/maps/public/layers/joins/inner_join', () => {}); jest.mock('../../../../../plugins/maps/public/reducers/non_serializable_instances', () => ({ getInspectorAdapters: () => { return {}; diff --git a/x-pack/plugins/maps/public/components/__snapshots__/add_tooltip_field_popover.test.js.snap b/x-pack/plugins/maps/public/components/__snapshots__/add_tooltip_field_popover.test.js.snap new file mode 100644 index 0000000000000..d0cdbe7243abe --- /dev/null +++ b/x-pack/plugins/maps/public/components/__snapshots__/add_tooltip_field_popover.test.js.snap @@ -0,0 +1,159 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Should remove selected fields from selectable 1`] = ` + + + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="addTooltipFieldPopover" + isOpen={false} + ownFocus={true} + panelPaddingSize="none" +> + , + "value": "@timestamp", + }, + ] + } + searchProps={ + Object { + "compressed": true, + } + } + searchable={true} + singleSelection={false} + > + + + + + + + Add + + + + +`; + +exports[`Should render 1`] = ` + + + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="addTooltipFieldPopover" + isOpen={false} + ownFocus={true} + panelPaddingSize="none" +> + , + "value": "@timestamp", + }, + Object { + "label": "custom label for prop1", + "prepend": , + "value": "prop1", + }, + Object { + "label": "prop2", + "prepend": , + "value": "prop2", + }, + ] + } + searchProps={ + Object { + "compressed": true, + } + } + searchable={true} + singleSelection={false} + > + + + + + + + Add + + + + +`; diff --git a/x-pack/plugins/maps/public/components/__snapshots__/tooltip_selector.test.js.snap b/x-pack/plugins/maps/public/components/__snapshots__/tooltip_selector.test.js.snap new file mode 100644 index 0000000000000..e21f034161a87 --- /dev/null +++ b/x-pack/plugins/maps/public/components/__snapshots__/tooltip_selector.test.js.snap @@ -0,0 +1,49 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TooltipSelector should render component 1`] = ` +
+ + + + + + + + + +
+`; diff --git a/x-pack/plugins/maps/public/components/__snapshots__/validated_range.test.js.snap b/x-pack/plugins/maps/public/components/__snapshots__/validated_range.test.js.snap new file mode 100644 index 0000000000000..1faf4f0c1105c --- /dev/null +++ b/x-pack/plugins/maps/public/components/__snapshots__/validated_range.test.js.snap @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Should display error message when value is outside of range 1`] = ` +
+ + + + +
+`; + +exports[`Should pass slider props to slider 1`] = ` + +`; + +exports[`Should render slider 1`] = ` + +`; diff --git a/x-pack/plugins/maps/public/meta.test.js b/x-pack/plugins/maps/public/meta.test.js index 64dd73fe109ff..d83f2adb35ef7 100644 --- a/x-pack/plugins/maps/public/meta.test.js +++ b/x-pack/plugins/maps/public/meta.test.js @@ -9,39 +9,24 @@ import { getEMSClient } from './meta'; jest.mock('@elastic/ems-client'); -jest.mock('ui/chrome', () => ({ - getBasePath: () => { - return ''; - }, - getInjected(key) { - if (key === 'proxyElasticMapsServiceInMaps') { - return false; - } else if (key === 'isEmsEnabled') { - return true; - } else if (key === 'emsFileApiUrl') { - return 'https://file-api'; - } else if (key === 'emsTileApiUrl') { - return 'https://tile-api'; - } - }, - getUiSettingsClient: () => { - return { - get: () => { - return ''; - }, +describe('default use without proxy', () => { + beforeEach(() => { + require('./kibana_services').getInjectedVarFunc = () => key => { + if (key === 'proxyElasticMapsServiceInMaps') { + return false; + } else if (key === 'isEmsEnabled') { + return true; + } else if (key === 'emsFileApiUrl') { + return 'https://file-api'; + } else if (key === 'emsTileApiUrl') { + return 'https://tile-api'; + } }; - }, -})); - -jest.mock('./kibana_services', () => { - return { - getLicenseId() { + require('./kibana_services').getLicenseId = () => { return 'foobarlicenseid'; - }, - }; -}); + }; + }); -describe('default use without proxy', () => { it('should construct EMSClient with absolute file and tile API urls', async () => { getEMSClient(); const mockEmsClientCall = EMSClient.mock.calls[0]; From 957f15374f47205ebf365833e6963c9a37ff1634 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Fri, 3 Apr 2020 15:10:20 -0600 Subject: [PATCH 12/14] Remove unused snapshots --- .../add_tooltip_field_popover.test.js.snap | 159 ------------------ .../tooltip_selector.test.js.snap | 49 ------ .../validated_range.test.js.snap | 72 -------- 3 files changed, 280 deletions(-) delete mode 100644 x-pack/legacy/plugins/maps/public/components/__snapshots__/add_tooltip_field_popover.test.js.snap delete mode 100644 x-pack/legacy/plugins/maps/public/components/__snapshots__/tooltip_selector.test.js.snap delete mode 100644 x-pack/legacy/plugins/maps/public/components/__snapshots__/validated_range.test.js.snap diff --git a/x-pack/legacy/plugins/maps/public/components/__snapshots__/add_tooltip_field_popover.test.js.snap b/x-pack/legacy/plugins/maps/public/components/__snapshots__/add_tooltip_field_popover.test.js.snap deleted file mode 100644 index d0cdbe7243abe..0000000000000 --- a/x-pack/legacy/plugins/maps/public/components/__snapshots__/add_tooltip_field_popover.test.js.snap +++ /dev/null @@ -1,159 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Should remove selected fields from selectable 1`] = ` - - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="addTooltipFieldPopover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" -> - , - "value": "@timestamp", - }, - ] - } - searchProps={ - Object { - "compressed": true, - } - } - searchable={true} - singleSelection={false} - > - - - - - - - Add - - - - -`; - -exports[`Should render 1`] = ` - - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="addTooltipFieldPopover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" -> - , - "value": "@timestamp", - }, - Object { - "label": "custom label for prop1", - "prepend": , - "value": "prop1", - }, - Object { - "label": "prop2", - "prepend": , - "value": "prop2", - }, - ] - } - searchProps={ - Object { - "compressed": true, - } - } - searchable={true} - singleSelection={false} - > - - - - - - - Add - - - - -`; diff --git a/x-pack/legacy/plugins/maps/public/components/__snapshots__/tooltip_selector.test.js.snap b/x-pack/legacy/plugins/maps/public/components/__snapshots__/tooltip_selector.test.js.snap deleted file mode 100644 index e21f034161a87..0000000000000 --- a/x-pack/legacy/plugins/maps/public/components/__snapshots__/tooltip_selector.test.js.snap +++ /dev/null @@ -1,49 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`TooltipSelector should render component 1`] = ` -
- - - - - - - - - -
-`; diff --git a/x-pack/legacy/plugins/maps/public/components/__snapshots__/validated_range.test.js.snap b/x-pack/legacy/plugins/maps/public/components/__snapshots__/validated_range.test.js.snap deleted file mode 100644 index 1faf4f0c1105c..0000000000000 --- a/x-pack/legacy/plugins/maps/public/components/__snapshots__/validated_range.test.js.snap +++ /dev/null @@ -1,72 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Should display error message when value is outside of range 1`] = ` -
- - - - -
-`; - -exports[`Should pass slider props to slider 1`] = ` - -`; - -exports[`Should render slider 1`] = ` - -`; From 2222a8664e9e3dec50796b33ce358bc1466c8820 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Fri, 3 Apr 2020 15:11:26 -0600 Subject: [PATCH 13/14] Add np service init to embeddables too --- .../maps/public/embeddable/map_embeddable_factory.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.ts b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.ts index 5a036ed47fb62..5deb3057a449e 100644 --- a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.ts +++ b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.ts @@ -27,6 +27,11 @@ import { getInitialLayers } from '../angular/get_initial_layers'; import { mergeInputWithSavedMap } from './merge_input_with_saved_map'; import '../angular/services/gis_map_saved_object_loader'; import { bindSetupCoreAndPlugins, bindStartCoreAndPlugins } from '../plugin'; +// @ts-ignore +import { + bindSetupCoreAndPlugins as bindNpSetupCoreAndPlugins, + bindStartCoreAndPlugins as bindNpStartCoreAndPlugins, +} from '../../../../../plugins/maps/public/plugin'; // eslint-disable-line @kbn/eslint/no-restricted-paths export class MapEmbeddableFactory implements EmbeddableFactoryDefinition { type = MAP_SAVED_OBJECT_TYPE; @@ -40,7 +45,9 @@ export class MapEmbeddableFactory implements EmbeddableFactoryDefinition { constructor() { // Init required services. Necessary while in legacy bindSetupCoreAndPlugins(npSetup.core, npSetup.plugins); + bindNpSetupCoreAndPlugins(npSetup.core, npSetup.plugins); bindStartCoreAndPlugins(npStart.core, npStart.plugins); + bindNpStartCoreAndPlugins(npStart.core, npStart.plugins); } async isEditable() { From 14731a21489ea6db193ef73974c66ecf36b92b4a Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Mon, 6 Apr 2020 10:53:54 -0600 Subject: [PATCH 14/14] Move validate color picker to NP --- .../styles/vector/components/color/mb_validated_color_picker.tsx | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename x-pack/{legacy => }/plugins/maps/public/layers/styles/vector/components/color/mb_validated_color_picker.tsx (100%) diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/mb_validated_color_picker.tsx b/x-pack/plugins/maps/public/layers/styles/vector/components/color/mb_validated_color_picker.tsx similarity index 100% rename from x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/mb_validated_color_picker.tsx rename to x-pack/plugins/maps/public/layers/styles/vector/components/color/mb_validated_color_picker.tsx