From a36f27c29d3a1104bd15020ef513d930853160e9 Mon Sep 17 00:00:00 2001 From: Vadim Dalecky Date: Tue, 8 Oct 2019 01:32:39 +0200 Subject: [PATCH] =?UTF-8?q?visualizations=20=F0=9F=91=89=20NP-ready=20(#47?= =?UTF-8?q?142)=20(#47452)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 improve visualizations NP-ready plugin * fix: 🐛 fix imports of visualizations plugin NP-ready * fix: 🐛 remove dependency on non-existing plugin * fix: 🐛 remove dependencies on non-existing 'visualizations' pl * fix: 🐛 use new visualizations plugin NP-ready legacy import --- .../input_control_vis/public/register_vis.js | 2 +- .../public/functions/visualization.ts | 2 +- .../public/kbn_vislib_vis_types.js | 2 +- .../kibana/public/visualize/editor/editor.js | 2 +- .../visualize_embeddable_factory.tsx | 4 +- .../visualize/listing/visualize_listing.js | 2 +- .../saved_visualizations.js | 2 +- .../visualize/wizard/new_vis_modal.test.tsx | 2 +- .../public/visualize/wizard/new_vis_modal.tsx | 2 +- .../public/visualize/wizard/show_new_vis.tsx | 2 +- .../wizard/type_selection/type_selection.tsx | 2 +- src/legacy/core_plugins/region_map/index.ts | 2 +- .../__tests__/region_map_visualization.js | 2 +- .../core_plugins/region_map/public/legacy.ts | 2 +- src/legacy/core_plugins/tile_map/index.ts | 2 +- .../coordinate_maps_visualization.js | 2 +- .../core_plugins/tile_map/public/legacy.ts | 2 +- .../core_plugins/timelion/public/legacy.ts | 2 +- .../core_plugins/timelion/public/plugin.ts | 2 +- .../core_plugins/vis_type_markdown/index.ts | 2 +- .../vis_type_markdown/public/legacy.ts | 2 +- .../core_plugins/vis_type_metric/index.ts | 2 +- .../vis_type_metric/public/legacy.ts | 2 +- .../core_plugins/vis_type_table/index.ts | 2 +- .../public/__tests__/table_vis_controller.js | 2 +- .../public/agg_table/__tests__/agg_table.js | 2 +- .../vis_type_table/public/legacy.ts | 2 +- .../core_plugins/vis_type_tagcloud/index.ts | 2 +- .../vis_type_tagcloud/public/legacy.ts | 2 +- .../core_plugins/vis_type_timeseries/index.ts | 2 +- .../vis_type_timeseries/public/legacy.ts | 2 +- .../core_plugins/vis_type_vega/index.ts | 2 +- .../public/__tests__/vega_visualization.js | 2 +- .../vis_type_vega/public/legacy.ts | 2 +- .../core_plugins/visualizations/index.ts | 38 ------------------- .../core_plugins/visualizations/package.json | 4 -- .../visualizations/public/index.ts | 4 +- .../public/np_ready/kibana.json | 10 +++++ .../{ => public}/filters/filters_service.ts | 0 .../np_ready/{ => public}/filters/index.ts | 0 .../public/np_ready/{ => public}/index.ts | 1 + .../public/{ => np_ready/public}/legacy.ts | 20 ++-------- .../public/{ => np_ready/public}/mocks.ts | 17 ++++----- .../public/np_ready/{ => public}/plugin.ts | 0 .../np_ready/{ => public}/types/index.ts | 0 .../{ => public}/types/types_service.ts | 0 .../types/vis_type_alias_registry.ts | 0 src/legacy/ui/public/vis/__tests__/_vis.js | 2 +- src/legacy/ui/public/vis/vis.js | 2 +- src/legacy/ui/public/visualize/loader/vis.js | 2 +- .../self_changing_vis/self_changing_vis.js | 2 +- .../maps/public/register_vis_type_alias.js | 2 +- 52 files changed, 64 insertions(+), 110 deletions(-) delete mode 100644 src/legacy/core_plugins/visualizations/index.ts delete mode 100644 src/legacy/core_plugins/visualizations/package.json create mode 100644 src/legacy/core_plugins/visualizations/public/np_ready/kibana.json rename src/legacy/core_plugins/visualizations/public/np_ready/{ => public}/filters/filters_service.ts (100%) rename src/legacy/core_plugins/visualizations/public/np_ready/{ => public}/filters/index.ts (100%) rename src/legacy/core_plugins/visualizations/public/np_ready/{ => public}/index.ts (99%) rename src/legacy/core_plugins/visualizations/public/{ => np_ready/public}/legacy.ts (62%) rename src/legacy/core_plugins/visualizations/public/{ => np_ready/public}/mocks.ts (89%) rename src/legacy/core_plugins/visualizations/public/np_ready/{ => public}/plugin.ts (100%) rename src/legacy/core_plugins/visualizations/public/np_ready/{ => public}/types/index.ts (100%) rename src/legacy/core_plugins/visualizations/public/np_ready/{ => public}/types/types_service.ts (100%) rename src/legacy/core_plugins/visualizations/public/np_ready/{ => public}/types/vis_type_alias_registry.ts (100%) diff --git a/src/legacy/core_plugins/input_control_vis/public/register_vis.js b/src/legacy/core_plugins/input_control_vis/public/register_vis.js index 76320b331bb06..731cf2dac9dd2 100644 --- a/src/legacy/core_plugins/input_control_vis/public/register_vis.js +++ b/src/legacy/core_plugins/input_control_vis/public/register_vis.js @@ -24,7 +24,7 @@ import { OptionsTab } from './components/editor/options_tab'; import { defaultFeedbackMessage } from 'ui/vis/default_feedback_message'; import { Status } from 'ui/vis/update_status'; import { i18n } from '@kbn/i18n'; -import { setup as visualizations } from '../../visualizations/public/legacy'; +import { setup as visualizations } from '../../visualizations/public/np_ready/public/legacy'; function InputControlVisProvider() { diff --git a/src/legacy/core_plugins/interpreter/public/functions/visualization.ts b/src/legacy/core_plugins/interpreter/public/functions/visualization.ts index 159395e7654f4..002da58f02ddb 100644 --- a/src/legacy/core_plugins/interpreter/public/functions/visualization.ts +++ b/src/legacy/core_plugins/interpreter/public/functions/visualization.ts @@ -24,7 +24,7 @@ import { FilterBarQueryFilterProvider } from 'ui/filter_manager/query_filter'; import { PersistedState } from 'ui/persisted_state'; import { VisResponseValue } from 'src/plugins/visualizations/public'; import { setup as data } from '../../../data/public/legacy'; -import { start as visualizations } from '../../../visualizations/public/legacy'; +import { start as visualizations } from '../../../visualizations/public/np_ready/public/legacy'; import { ExpressionFunction, Render } from '../../types'; interface Arguments { diff --git a/src/legacy/core_plugins/kbn_vislib_vis_types/public/kbn_vislib_vis_types.js b/src/legacy/core_plugins/kbn_vislib_vis_types/public/kbn_vislib_vis_types.js index b11f21a96f38d..fe2cca3b80064 100644 --- a/src/legacy/core_plugins/kbn_vislib_vis_types/public/kbn_vislib_vis_types.js +++ b/src/legacy/core_plugins/kbn_vislib_vis_types/public/kbn_vislib_vis_types.js @@ -17,7 +17,7 @@ * under the License. */ -import { setup as visualizations } from '../../visualizations/public/legacy'; +import { setup as visualizations } from '../../visualizations/public/np_ready/public/legacy'; import histogramVisTypeProvider from './histogram'; import lineVisTypeProvider from './line'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js b/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js index 85a9fc4bed124..ad7127addaaa0 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js +++ b/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js @@ -54,7 +54,7 @@ import { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_s import { getEditBreadcrumbs, getCreateBreadcrumbs } from '../breadcrumbs'; import { npStart } from 'ui/new_platform'; import { setup as data } from '../../../../../core_plugins/data/public/legacy'; -import { start as visualizations } from '../../../../visualizations/public/legacy'; +import { start as visualizations } from '../../../../visualizations/public/np_ready/public/legacy'; const { savedQueryService } = data.search.services; diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.tsx b/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.tsx index 52dcaaa05b94d..3b49287cced81 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.tsx @@ -52,14 +52,14 @@ import { Container, EmbeddableOutput, } from '../../../../../../plugins/embeddable/public'; -import { start as visualizations } from '../../../../visualizations/public/legacy'; +import { start as visualizations } from '../../../../visualizations/public/np_ready/public/legacy'; import { showNewVisModal } from '../wizard'; import { SavedVisualizations } from '../types'; import { DisabledLabEmbeddable } from './disabled_lab_embeddable'; import { getIndexPattern } from './get_index_pattern'; import { VisualizeEmbeddable, VisualizeInput, VisualizeOutput } from './visualize_embeddable'; import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; -import { TypesStart } from '../../../../visualizations/public/np_ready/types'; +import { TypesStart } from '../../../../visualizations/public/np_ready/public/types'; interface VisualizationAttributes extends SavedObjectAttributes { visState: string; diff --git a/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js b/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js index e6c02bac54df4..54162e8f80221 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js +++ b/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js @@ -28,7 +28,7 @@ import { SavedObjectsClientProvider } from 'ui/saved_objects'; import { VisualizeListingTable } from './visualize_listing_table'; import { NewVisModal } from '../wizard/new_vis_modal'; import { VisualizeConstants } from '../visualize_constants'; -import { start as visualizations } from '../../../../visualizations/public/legacy'; +import { start as visualizations } from '../../../../visualizations/public/np_ready/public/legacy'; import { i18n } from '@kbn/i18n'; const app = uiModules.get('app/visualize', ['ngRoute', 'react']); diff --git a/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.js b/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.js index cc48cbe2cb1b9..2d51fc1fa5e36 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.js +++ b/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.js @@ -21,7 +21,7 @@ import './_saved_vis'; import { uiModules } from 'ui/modules'; import { SavedObjectLoader, SavedObjectsClientProvider } from 'ui/saved_objects'; import { savedObjectManagementRegistry } from '../../management/saved_object_registry'; -import { start as visualizations } from '../../../../visualizations/public/legacy'; +import { start as visualizations } from '../../../../visualizations/public/np_ready/public/legacy'; import { createVisualizeEditUrl } from '../visualize_constants'; import { findListItems } from './find_list_items'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx index 00c60c7718262..6b2f51c3dcf2b 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx @@ -25,7 +25,7 @@ import { settingsGet } from './new_vis_modal.test.mocks'; import { NewVisModal } from './new_vis_modal'; import { VisType } from 'ui/vis'; -import { TypesStart } from '../../../../visualizations/public/np_ready/types'; +import { TypesStart } from '../../../../visualizations/public/np_ready/public/types'; describe('NewVisModal', () => { const defaultVisTypeParams = { diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx index 1279157f6a974..506f4f56d703b 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx @@ -28,7 +28,7 @@ import { VisualizeConstants } from '../visualize_constants'; import { SearchSelection } from './search_selection'; import { TypeSelection } from './type_selection'; -import { TypesStart } from '../../../../visualizations/public/np_ready/types'; +import { TypesStart } from '../../../../visualizations/public/np_ready/public/types'; interface TypeSelectionProps { isOpen: boolean; diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx b/src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx index 2e43d3f78631c..fa2ca6747bc40 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx @@ -22,7 +22,7 @@ import ReactDOM from 'react-dom'; import { I18nContext } from 'ui/i18n'; import { NewVisModal } from './new_vis_modal'; -import { TypesStart } from '../../../../visualizations/public/np_ready/types'; +import { TypesStart } from '../../../../visualizations/public/np_ready/public/types'; interface ShowNewVisModalParams { editorParams?: string[]; diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx b/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx index a4a37e6143f62..04d5456dbf80d 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx @@ -41,7 +41,7 @@ import { VisTypeAlias } from '../../../../../visualizations/public'; import { NewVisHelp } from './new_vis_help'; import { VisHelpText } from './vis_help_text'; import { VisTypeIcon } from './vis_type_icon'; -import { TypesStart } from '../../../../../visualizations/public/np_ready/types'; +import { TypesStart } from '../../../../../visualizations/public/np_ready/public/types'; interface VisTypeListEntry extends VisType { highlighted: boolean; diff --git a/src/legacy/core_plugins/region_map/index.ts b/src/legacy/core_plugins/region_map/index.ts index 258dc25f6a1e1..133d4be785d19 100644 --- a/src/legacy/core_plugins/region_map/index.ts +++ b/src/legacy/core_plugins/region_map/index.ts @@ -25,7 +25,7 @@ import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy const regionMapPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) => new Plugin({ id: 'region_map', - require: ['kibana', 'elasticsearch', 'visualizations', 'interpreter', 'expressions'], + require: ['kibana', 'elasticsearch', 'interpreter', 'expressions'], publicDir: resolve(__dirname, 'public'), uiExports: { hacks: [resolve(__dirname, 'public/legacy')], diff --git a/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js b/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js index 3d28a209acc21..9bfa413257967 100644 --- a/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js +++ b/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js @@ -39,7 +39,7 @@ import afterdatachangePng from './afterdatachange.png'; import afterdatachangeandresizePng from './afterdatachangeandresize.png'; import aftercolorchangePng from './aftercolorchange.png'; import changestartupPng from './changestartup.png'; -import { setup as visualizationsSetup } from '../../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../../visualizations/public/np_ready/public/legacy'; import { createRegionMapVisualization } from '../region_map_visualization'; import { createRegionMapTypeDefinition } from '../region_map_type'; diff --git a/src/legacy/core_plugins/region_map/public/legacy.ts b/src/legacy/core_plugins/region_map/public/legacy.ts index e16a21cb78cc5..495e558e29dd7 100644 --- a/src/legacy/core_plugins/region_map/public/legacy.ts +++ b/src/legacy/core_plugins/region_map/public/legacy.ts @@ -20,7 +20,7 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/np_ready/public/legacy'; import { RegionMapPluginSetupDependencies, RegionMapsConfig } from './plugin'; import { LegacyDependenciesPlugin } from './shim'; import { plugin } from '.'; diff --git a/src/legacy/core_plugins/tile_map/index.ts b/src/legacy/core_plugins/tile_map/index.ts index 15ce3bdb8e28b..b6ab88327f6bd 100644 --- a/src/legacy/core_plugins/tile_map/index.ts +++ b/src/legacy/core_plugins/tile_map/index.ts @@ -28,7 +28,7 @@ import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy const tileMapPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) => new Plugin({ id: 'tile_map', - require: ['kibana', 'elasticsearch', 'visualizations', 'interpreter', 'expressions'], + require: ['kibana', 'elasticsearch', 'interpreter', 'expressions'], publicDir: resolve(__dirname, 'public'), uiExports: { styleSheetPaths: resolve(__dirname, 'public/index.scss'), diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js b/src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js index a0cf3128ea88a..860c26bedd523 100644 --- a/src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js +++ b/src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js @@ -33,7 +33,7 @@ import EMS_TILES from '../../../../ui/public/vis/__tests__/map/ems_mocks/sample_ import EMS_STYLE_ROAD_MAP_BRIGHT from '../../../../ui/public/vis/__tests__/map/ems_mocks/sample_style_bright'; import EMS_STYLE_ROAD_MAP_DESATURATED from '../../../../ui/public/vis/__tests__/map/ems_mocks/sample_style_desaturated'; import EMS_STYLE_DARK_MAP from '../../../../ui/public/vis/__tests__/map/ems_mocks/sample_style_dark'; -import { setup as visualizationsSetup } from '../../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../../visualizations/public/np_ready/public/legacy'; import { createTileMapVisualization } from '../tile_map_visualization'; import { createTileMapTypeDefinition } from '../tile_map_type'; diff --git a/src/legacy/core_plugins/tile_map/public/legacy.ts b/src/legacy/core_plugins/tile_map/public/legacy.ts index c367a5b5376ca..74be8482bfd30 100644 --- a/src/legacy/core_plugins/tile_map/public/legacy.ts +++ b/src/legacy/core_plugins/tile_map/public/legacy.ts @@ -20,7 +20,7 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/np_ready/public/legacy'; import { TileMapPluginSetupDependencies } from './plugin'; import { LegacyDependenciesPlugin } from './shim'; import { plugin } from '.'; diff --git a/src/legacy/core_plugins/timelion/public/legacy.ts b/src/legacy/core_plugins/timelion/public/legacy.ts index 8b8b5d4330b42..5d4939191a6ca 100644 --- a/src/legacy/core_plugins/timelion/public/legacy.ts +++ b/src/legacy/core_plugins/timelion/public/legacy.ts @@ -20,7 +20,7 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; import { plugin } from '.'; -import { setup as visualizations } from '../../visualizations/public/legacy'; +import { setup as visualizations } from '../../visualizations/public/np_ready/public/legacy'; import { TimelionPluginSetupDependencies, TimelionPluginStartDependencies } from './plugin'; // @ts-ignore import panelRegistry from './lib/panel_registry'; diff --git a/src/legacy/core_plugins/timelion/public/plugin.ts b/src/legacy/core_plugins/timelion/public/plugin.ts index 4adfac3726b95..f7f0b48ef5011 100644 --- a/src/legacy/core_plugins/timelion/public/plugin.ts +++ b/src/legacy/core_plugins/timelion/public/plugin.ts @@ -26,7 +26,7 @@ import { HttpSetup, } from 'kibana/public'; import { Plugin as ExpressionsPlugin } from 'src/plugins/expressions/public'; -import { VisualizationsSetup } from '../../visualizations/public/np_ready'; +import { VisualizationsSetup } from '../../visualizations/public/np_ready/public'; import { getTimelionVisualizationConfig } from './timelion_vis_fn'; import { getTimelionVisualization } from './vis'; import { getTimeChart } from './panels/timechart/timechart'; diff --git a/src/legacy/core_plugins/vis_type_markdown/index.ts b/src/legacy/core_plugins/vis_type_markdown/index.ts index 8106e5d30ddd0..1135872b24b8a 100644 --- a/src/legacy/core_plugins/vis_type_markdown/index.ts +++ b/src/legacy/core_plugins/vis_type_markdown/index.ts @@ -25,7 +25,7 @@ import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy const markdownPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) => new Plugin({ id: 'markdown_vis', - require: ['kibana', 'elasticsearch', 'visualizations', 'interpreter', 'expressions'], + require: ['kibana', 'elasticsearch', 'interpreter', 'expressions'], publicDir: resolve(__dirname, 'public'), uiExports: { styleSheetPaths: resolve(__dirname, 'public/index.scss'), diff --git a/src/legacy/core_plugins/vis_type_markdown/public/legacy.ts b/src/legacy/core_plugins/vis_type_markdown/public/legacy.ts index 6074137532ae9..d4a5290df865c 100644 --- a/src/legacy/core_plugins/vis_type_markdown/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_markdown/public/legacy.ts @@ -20,7 +20,7 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/np_ready/public/legacy'; import { MarkdownPluginSetupDependencies } from './plugin'; import { plugin } from '.'; diff --git a/src/legacy/core_plugins/vis_type_metric/index.ts b/src/legacy/core_plugins/vis_type_metric/index.ts index f71fc4a75461e..d5a86abfdc288 100644 --- a/src/legacy/core_plugins/vis_type_metric/index.ts +++ b/src/legacy/core_plugins/vis_type_metric/index.ts @@ -25,7 +25,7 @@ import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy const metricPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) => new Plugin({ id: 'metric_vis', - require: ['kibana', 'elasticsearch', 'visualizations', 'interpreter', 'expressions'], + require: ['kibana', 'elasticsearch', 'interpreter', 'expressions'], publicDir: resolve(__dirname, 'public'), uiExports: { styleSheetPaths: resolve(__dirname, 'public/index.scss'), diff --git a/src/legacy/core_plugins/vis_type_metric/public/legacy.ts b/src/legacy/core_plugins/vis_type_metric/public/legacy.ts index c5fc86c7e35f5..f214bcbc82f7d 100644 --- a/src/legacy/core_plugins/vis_type_metric/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_metric/public/legacy.ts @@ -20,7 +20,7 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/np_ready/public/legacy'; import { MetricVisPluginSetupDependencies } from './plugin'; import { LegacyDependenciesPlugin } from './shim'; import { plugin } from '.'; diff --git a/src/legacy/core_plugins/vis_type_table/index.ts b/src/legacy/core_plugins/vis_type_table/index.ts index 3847dd6b58268..eba7af17c2057 100644 --- a/src/legacy/core_plugins/vis_type_table/index.ts +++ b/src/legacy/core_plugins/vis_type_table/index.ts @@ -25,7 +25,7 @@ import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy const tableVisPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) => new Plugin({ id: 'table_vis', - require: ['kibana', 'elasticsearch', 'visualizations', 'interpreter', 'expressions'], + require: ['kibana', 'elasticsearch', 'interpreter', 'expressions'], publicDir: resolve(__dirname, 'public'), uiExports: { styleSheetPaths: resolve(__dirname, 'public/index.scss'), diff --git a/src/legacy/core_plugins/vis_type_table/public/__tests__/table_vis_controller.js b/src/legacy/core_plugins/vis_type_table/public/__tests__/table_vis_controller.js index 94c8fec650dcf..abebf8190dc9f 100644 --- a/src/legacy/core_plugins/vis_type_table/public/__tests__/table_vis_controller.js +++ b/src/legacy/core_plugins/vis_type_table/public/__tests__/table_vis_controller.js @@ -28,7 +28,7 @@ import { AppStateProvider } from 'ui/state_management/app_state'; import { tabifyAggResponse } from 'ui/agg_response/tabify'; import { createTableVisTypeDefinition } from '../table_vis_type'; -import { setup as visualizationsSetup } from '../../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../../visualizations/public/np_ready/public/legacy'; describe('Table Vis - Controller', async function () { let $rootScope; diff --git a/src/legacy/core_plugins/vis_type_table/public/agg_table/__tests__/agg_table.js b/src/legacy/core_plugins/vis_type_table/public/agg_table/__tests__/agg_table.js index 4dad6bf5e44a0..d22ff92c4d3f6 100644 --- a/src/legacy/core_plugins/vis_type_table/public/agg_table/__tests__/agg_table.js +++ b/src/legacy/core_plugins/vis_type_table/public/agg_table/__tests__/agg_table.js @@ -31,7 +31,7 @@ import { round } from 'lodash'; import { VisFactoryProvider } from 'ui/vis/vis_factory'; import { createTableVisTypeDefinition } from '../../table_vis_type'; -import { setup as visualizationsSetup } from '../../../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../../../visualizations/public/np_ready/public/legacy'; describe('Table Vis - AggTable Directive', function () { let $rootScope; diff --git a/src/legacy/core_plugins/vis_type_table/public/legacy.ts b/src/legacy/core_plugins/vis_type_table/public/legacy.ts index 5ec181f0e6974..8513622dec9aa 100644 --- a/src/legacy/core_plugins/vis_type_table/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_table/public/legacy.ts @@ -22,7 +22,7 @@ import { npSetup, npStart } from 'ui/new_platform'; import { plugin } from '.'; import { TablePluginSetupDependencies } from './plugin'; -import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/np_ready/public/legacy'; import { LegacyDependenciesPlugin } from './shim'; const plugins: Readonly = { diff --git a/src/legacy/core_plugins/vis_type_tagcloud/index.ts b/src/legacy/core_plugins/vis_type_tagcloud/index.ts index a086a5af0261d..18dc8c9d78b74 100644 --- a/src/legacy/core_plugins/vis_type_tagcloud/index.ts +++ b/src/legacy/core_plugins/vis_type_tagcloud/index.ts @@ -25,7 +25,7 @@ import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy const tagCloudPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) => new Plugin({ id: 'tagcloud', - require: ['kibana', 'elasticsearch', 'visualizations', 'interpreter', 'expressions'], + require: ['kibana', 'elasticsearch', 'interpreter', 'expressions'], publicDir: resolve(__dirname, 'public'), uiExports: { styleSheetPaths: resolve(__dirname, 'public/index.scss'), diff --git a/src/legacy/core_plugins/vis_type_tagcloud/public/legacy.ts b/src/legacy/core_plugins/vis_type_tagcloud/public/legacy.ts index f173eff0aef88..66710791edc83 100644 --- a/src/legacy/core_plugins/vis_type_tagcloud/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_tagcloud/public/legacy.ts @@ -20,7 +20,7 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/np_ready/public/legacy'; import { TagCloudPluginSetupDependencies } from './plugin'; import { plugin } from '.'; diff --git a/src/legacy/core_plugins/vis_type_timeseries/index.ts b/src/legacy/core_plugins/vis_type_timeseries/index.ts index f302e36c046c4..215e7975d97c8 100644 --- a/src/legacy/core_plugins/vis_type_timeseries/index.ts +++ b/src/legacy/core_plugins/vis_type_timeseries/index.ts @@ -30,7 +30,7 @@ import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy const metricsPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) => new Plugin({ id: 'metrics', - require: ['kibana', 'elasticsearch', 'visualizations', 'interpreter', 'expressions'], + require: ['kibana', 'elasticsearch', 'interpreter', 'expressions'], publicDir: resolve(__dirname, 'public'), uiExports: { styleSheetPaths: resolve(__dirname, 'public/index.scss'), diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/legacy.ts b/src/legacy/core_plugins/vis_type_timeseries/public/legacy.ts index 17bfc3232c2ad..93b35ee284f18 100644 --- a/src/legacy/core_plugins/vis_type_timeseries/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_timeseries/public/legacy.ts @@ -20,7 +20,7 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/np_ready/public/legacy'; import { MetricsPluginSetupDependencies } from './plugin'; import { plugin } from '.'; diff --git a/src/legacy/core_plugins/vis_type_vega/index.ts b/src/legacy/core_plugins/vis_type_vega/index.ts index 3c18b548413f4..59d1ad6457711 100644 --- a/src/legacy/core_plugins/vis_type_vega/index.ts +++ b/src/legacy/core_plugins/vis_type_vega/index.ts @@ -28,7 +28,7 @@ const vegaPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPlugin // It is required to change the configuration property // vega.enableExternalUrls -> vis_type_vega.enableExternalUrls id: 'vega', - require: ['kibana', 'elasticsearch', 'visualizations', 'interpreter', 'expressions'], + require: ['kibana', 'elasticsearch', 'interpreter', 'expressions'], publicDir: resolve(__dirname, 'public'), uiExports: { styleSheetPaths: resolve(__dirname, 'public/index.scss'), diff --git a/src/legacy/core_plugins/vis_type_vega/public/__tests__/vega_visualization.js b/src/legacy/core_plugins/vis_type_vega/public/__tests__/vega_visualization.js index b3b11ffe7a951..13f4ce06f1b62 100644 --- a/src/legacy/core_plugins/vis_type_vega/public/__tests__/vega_visualization.js +++ b/src/legacy/core_plugins/vis_type_vega/public/__tests__/vega_visualization.js @@ -41,7 +41,7 @@ import vegaMapImage256 from './vega_map_image_256.png'; import { VegaParser } from '../data_model/vega_parser'; import { SearchCache } from '../data_model/search_cache'; -import { setup as visualizationsSetup } from '../../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../../visualizations/public/np_ready/public/legacy'; import { createVegaTypeDefinition } from '../vega_type'; const THRESHOLD = 0.1; diff --git a/src/legacy/core_plugins/vis_type_vega/public/legacy.ts b/src/legacy/core_plugins/vis_type_vega/public/legacy.ts index 73e03f6d323c2..d40212bec3b7f 100644 --- a/src/legacy/core_plugins/vis_type_vega/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_vega/public/legacy.ts @@ -20,7 +20,7 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/np_ready/public/legacy'; import { VegaPluginSetupDependencies } from './plugin'; import { LegacyDependenciesPlugin } from './shim'; import { plugin } from '.'; diff --git a/src/legacy/core_plugins/visualizations/index.ts b/src/legacy/core_plugins/visualizations/index.ts deleted file mode 100644 index bb9ef1588bdc2..0000000000000 --- a/src/legacy/core_plugins/visualizations/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { resolve } from 'path'; -import { Legacy } from '../../../../kibana'; - -// eslint-disable-next-line import/no-default-export -export default function VisualizationsPlugin(kibana: any) { - const config: Legacy.PluginSpecOptions = { - id: 'visualizations', - require: ['data'], - publicDir: resolve(__dirname, 'public'), - config: (Joi: any) => { - return Joi.object({ - enabled: Joi.boolean().default(true), - }).default(); - }, - init: (server: Legacy.Server) => ({}), - }; - - return new kibana.Plugin(config); -} diff --git a/src/legacy/core_plugins/visualizations/package.json b/src/legacy/core_plugins/visualizations/package.json deleted file mode 100644 index 5b436f0c2fef2..0000000000000 --- a/src/legacy/core_plugins/visualizations/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "visualizations", - "version": "kibana" -} diff --git a/src/legacy/core_plugins/visualizations/public/index.ts b/src/legacy/core_plugins/visualizations/public/index.ts index 997f18cbd5146..ad86c9ddb14c5 100644 --- a/src/legacy/core_plugins/visualizations/public/index.ts +++ b/src/legacy/core_plugins/visualizations/public/index.ts @@ -50,7 +50,7 @@ export { Status } from 'ui/vis/update_status'; * * @public */ -export * from './np_ready'; +export * from './np_ready/public'; // for backwards compatibility with 7.3 -export { setup as visualizations } from './legacy'; +export { setup as visualizations } from './np_ready/public/legacy'; diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/kibana.json b/src/legacy/core_plugins/visualizations/public/np_ready/kibana.json new file mode 100644 index 0000000000000..888edde44a261 --- /dev/null +++ b/src/legacy/core_plugins/visualizations/public/np_ready/kibana.json @@ -0,0 +1,10 @@ +{ + "id": "visualizations", + "version": "kibana", + "server": false, + "ui": true, + "requiredPlugins": [ + "data", + "search" + ] +} diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/filters/filters_service.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/filters/filters_service.ts similarity index 100% rename from src/legacy/core_plugins/visualizations/public/np_ready/filters/filters_service.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/public/filters/filters_service.ts diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/filters/index.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/filters/index.ts similarity index 100% rename from src/legacy/core_plugins/visualizations/public/np_ready/filters/index.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/public/filters/index.ts diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/index.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/index.ts similarity index 99% rename from src/legacy/core_plugins/visualizations/public/np_ready/index.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/public/index.ts index f43550676e1b2..5e1aa02712c08 100644 --- a/src/legacy/core_plugins/visualizations/public/np_ready/index.ts +++ b/src/legacy/core_plugins/visualizations/public/np_ready/public/index.ts @@ -28,6 +28,7 @@ * in the setup/start interfaces in `plugin.ts`. The remaining items exported here are * either types, or static code. */ + import { PluginInitializerContext } from 'src/core/public'; import { VisualizationsPlugin, VisualizationsSetup, VisualizationsStart } from './plugin'; diff --git a/src/legacy/core_plugins/visualizations/public/legacy.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/legacy.ts similarity index 62% rename from src/legacy/core_plugins/visualizations/public/legacy.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/public/legacy.ts index 088563a1970c3..16cec5d2d9e91 100644 --- a/src/legacy/core_plugins/visualizations/public/legacy.ts +++ b/src/legacy/core_plugins/visualizations/public/np_ready/public/legacy.ts @@ -17,27 +17,13 @@ * under the License. */ -/** - * New Platform Shim - * - * In this file, we import any legacy dependencies we have, and shim them into - * our plugin by manually constructing the values that the new platform will - * eventually be passing to the `setup/start` method of our plugin definition. - * - * The idea is that our `plugin.ts` can stay "pure" and not contain any legacy - * world code. Then when it comes time to migrate to the new platform, we can - * simply delete this shim file. - * - * We are also calling `setup/start` here and exporting our public contract so that - * other legacy plugins are able to import from '../core_plugins/visualizations/legacy' - * and receive the response value of the `setup/start` contract, mimicking the - * data that will eventually be injected by the new platform. - */ - import { PluginInitializerContext } from 'src/core/public'; + +/* eslint-disable @kbn/eslint/no-restricted-paths */ import { npSetup, npStart } from 'ui/new_platform'; // @ts-ignore import { VisFiltersProvider, createFilter } from 'ui/vis/vis_filters'; +/* eslint-enable @kbn/eslint/no-restricted-paths */ import { plugin } from '.'; diff --git a/src/legacy/core_plugins/visualizations/public/mocks.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/mocks.ts similarity index 89% rename from src/legacy/core_plugins/visualizations/public/mocks.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/public/mocks.ts index 11dccbb173755..5dc0e452eea56 100644 --- a/src/legacy/core_plugins/visualizations/public/mocks.ts +++ b/src/legacy/core_plugins/visualizations/public/np_ready/public/mocks.ts @@ -22,18 +22,17 @@ jest.mock('ui/vis/default_feedback_message'); jest.mock('ui/vis/index.js'); jest.mock('ui/vis/vis_factory'); jest.mock('ui/registry/vis_types'); -// @ts-ignore -import { VisFiltersProvider, createFilter } from 'ui/vis/vis_filters'; -// @ts-ignore -import { VisProvider as Vis } from 'ui/vis/index.js'; -// @ts-ignore -import { VisFactoryProvider } from 'ui/vis/vis_factory'; jest.mock('./types/vis_type_alias_registry'); -import { PluginInitializerContext } from 'src/core/public'; +import { PluginInitializerContext } from 'src/core/public'; import { VisualizationsSetup, VisualizationsStart } from './'; -import { VisualizationsPlugin } from './np_ready/plugin'; -import { coreMock } from '../../../../core/public/mocks'; +import { VisualizationsPlugin } from './plugin'; +import { coreMock } from '../../../../../../core/public/mocks'; + +/* eslint-disable */ +// @ts-ignore +import { VisFiltersProvider, createFilter } from 'ui/vis/vis_filters'; +/* eslint-enable */ const createSetupContract = (): VisualizationsSetup => ({ filters: { diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/plugin.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/plugin.ts similarity index 100% rename from src/legacy/core_plugins/visualizations/public/np_ready/plugin.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/public/plugin.ts diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/types/index.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/types/index.ts similarity index 100% rename from src/legacy/core_plugins/visualizations/public/np_ready/types/index.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/public/types/index.ts diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/types/types_service.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/types/types_service.ts similarity index 100% rename from src/legacy/core_plugins/visualizations/public/np_ready/types/types_service.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/public/types/types_service.ts diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/types/vis_type_alias_registry.ts b/src/legacy/core_plugins/visualizations/public/np_ready/public/types/vis_type_alias_registry.ts similarity index 100% rename from src/legacy/core_plugins/visualizations/public/np_ready/types/vis_type_alias_registry.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/public/types/vis_type_alias_registry.ts diff --git a/src/legacy/ui/public/vis/__tests__/_vis.js b/src/legacy/ui/public/vis/__tests__/_vis.js index 9ecfd90b29fe5..5a2f93ab35b50 100644 --- a/src/legacy/ui/public/vis/__tests__/_vis.js +++ b/src/legacy/ui/public/vis/__tests__/_vis.js @@ -22,7 +22,7 @@ import ngMock from 'ng_mock'; import expect from '@kbn/expect'; import { VisProvider } from '..'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; -import { start as visualizations } from '../../../../core_plugins/visualizations/public/legacy'; +import { start as visualizations } from '../../../../core_plugins/visualizations/public/np_ready/public/legacy'; describe('Vis Class', function () { let indexPattern; diff --git a/src/legacy/ui/public/vis/vis.js b/src/legacy/ui/public/vis/vis.js index b3f032ae98d62..c34fc1b10378e 100644 --- a/src/legacy/ui/public/vis/vis.js +++ b/src/legacy/ui/public/vis/vis.js @@ -34,7 +34,7 @@ import { AggConfigs } from '../agg_types/agg_configs'; import { PersistedState } from '../persisted_state'; import { updateVisualizationConfig } from './vis_update'; import { SearchSourceProvider } from '../courier/search_source'; -import { start as visualizations } from '../../../core_plugins/visualizations/public/legacy'; +import { start as visualizations } from '../../../core_plugins/visualizations/public/np_ready/public/legacy'; import '../directives/bind'; diff --git a/src/legacy/ui/public/visualize/loader/vis.js b/src/legacy/ui/public/visualize/loader/vis.js index 39acf795a9372..85ab07528b846 100644 --- a/src/legacy/ui/public/visualize/loader/vis.js +++ b/src/legacy/ui/public/visualize/loader/vis.js @@ -31,7 +31,7 @@ import { EventEmitter } from 'events'; import _ from 'lodash'; import { PersistedState } from '../../persisted_state'; -import { start as visualizations } from '../../../../core_plugins/visualizations/public/legacy'; +import { start as visualizations } from '../../../../core_plugins/visualizations/public/np_ready/public/legacy'; export function VisProvider(indexPatterns, getAppState) { diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/public/self_changing_vis/self_changing_vis.js b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/public/self_changing_vis/self_changing_vis.js index daa493c727fd0..c2d8ed7f5f9c1 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/public/self_changing_vis/self_changing_vis.js +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/public/self_changing_vis/self_changing_vis.js @@ -22,7 +22,7 @@ import { visFactory } from 'ui/vis/vis_factory'; import { SelfChangingEditor } from './self_changing_editor'; import { SelfChangingComponent } from './self_changing_components'; -import { setup as visualizations } from '../../../../../../src/legacy/core_plugins/visualizations/public/legacy'; +import { setup as visualizations } from '../../../../../../src/legacy/core_plugins/visualizations/public/np_ready/public/legacy'; function SelfChangingVisType() { diff --git a/x-pack/legacy/plugins/maps/public/register_vis_type_alias.js b/x-pack/legacy/plugins/maps/public/register_vis_type_alias.js index 3708957159f61..d82261b7cf84c 100644 --- a/x-pack/legacy/plugins/maps/public/register_vis_type_alias.js +++ b/x-pack/legacy/plugins/maps/public/register_vis_type_alias.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { setup as visualizationsSetup } from '../../../../../src/legacy/core_plugins/visualizations/public/legacy'; +import { setup as visualizationsSetup } from '../../../../../src/legacy/core_plugins/visualizations/public/np_ready/public/legacy'; import { i18n } from '@kbn/i18n'; import { APP_ID, APP_ICON, MAP_BASE_URL } from '../common/constants';