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 4da6ed16a144..c2a7afa1875b 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 @@ -30,7 +30,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 { setup } from '../../../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../../../visualizations/public/legacy'; import { i18n } from '@kbn/i18n'; const app = uiModules.get('app/visualize', ['ngRoute', 'react']); @@ -46,7 +46,7 @@ export function VisualizeListingController($injector, createNewVis) { const savedObjectClient = Private(SavedObjectsClientProvider); this.visTypeRegistry = Private(VisTypesRegistryProvider); - this.visTypeAliases = setup.types.visTypeAliasRegistry.get(); + this.visTypeAliases = visualizationsSetup.types.visTypeAliasRegistry.get(); timefilter.disableAutoRefreshSelector(); timefilter.disableTimeRangeSelector(); 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 5f0a2be54e09..f65802a9dca1 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 @@ -22,7 +22,7 @@ import { VisTypesRegistryProvider } from 'ui/registry/vis_types'; import { uiModules } from 'ui/modules'; import { SavedObjectLoader, SavedObjectsClientProvider } from 'ui/saved_objects'; import { savedObjectManagementRegistry } from '../../management/saved_object_registry'; -import { setup } from '../../../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../../../visualizations/public/legacy'; import { createVisualizeEditUrl } from '../visualize_constants'; import { findListItems } from './find_list_items'; @@ -86,7 +86,7 @@ app.service('savedVisualizations', function (SavedVis, Private, kbnUrl, chrome) size, mapSavedObjectApiHits: this.mapSavedObjectApiHits.bind(this), savedObjectsClient: this.savedObjectsClient, - visTypes: setup.types.visTypeAliasRegistry.get(), + visTypes: visualizationsSetup.types.visTypeAliasRegistry.get(), }); }; 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 f7bb0a8f4573..52815f6a0737 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 @@ -24,7 +24,7 @@ import { i18n } from '@kbn/i18n'; import chrome from 'ui/chrome'; import { VisType } from 'ui/vis'; -import { VisTypeAlias } from '../../../../visualizations/public/np_ready/public'; +import { VisTypeAlias } from '../../../../visualizations/public'; import { VisualizeConstants } from '../visualize_constants'; import { SearchSelection } from './search_selection'; 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 76fc84921627..43df0ba92ffe 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 @@ -37,7 +37,7 @@ import { } from '@elastic/eui'; import { memoizeLast } from 'ui/utils/memoize'; import { VisType } from 'ui/vis'; -import { VisTypeAlias } from '../../../../../visualizations/public/np_ready/public'; +import { VisTypeAlias } from '../../../../../visualizations/public'; import { NewVisHelp } from './new_vis_help'; import { VisHelpText } from './vis_help_text'; import { VisTypeIcon } from './vis_type_icon'; 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 b0b40f8ff704..2d70c2120d5f 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 } from '../../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../../visualizations/public/legacy'; import { createRegionMapVisualization } from '../region_map_visualization'; import { createRegionMapTypeDefinition } from '../region_map_type'; @@ -106,7 +106,7 @@ describe('RegionMapsVisualizationTests', function () { uiSettings, }; - setup.types.registerVisualization(() => createRegionMapTypeDefinition(dependencies)); + visualizationsSetup.types.registerVisualization(() => createRegionMapTypeDefinition(dependencies)); Vis = Private(visModule.VisProvider); RegionMapsVisualization = createRegionMapVisualization(dependencies); diff --git a/src/legacy/core_plugins/region_map/public/legacy.ts b/src/legacy/core_plugins/region_map/public/legacy.ts index 7adbc2117d7e..b669a45e3240 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 setupVisualizations } from '../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; import { RegionMapPluginSetupDependencies, RegionMapsConfig } from './plugin'; import { LegacyDependenciesPlugin } from './shim'; import { plugin } from '.'; @@ -30,7 +30,7 @@ const regionmapsConfig = npSetup.core.injectedMetadata.getInjectedVar( ) as RegionMapsConfig; const plugins: Readonly = { - visualizations: setupVisualizations, + visualizations: visualizationsSetup, data: npSetup.plugins.data, // Temporary solution diff --git a/src/legacy/core_plugins/region_map/public/plugin.ts b/src/legacy/core_plugins/region_map/public/plugin.ts index 4afee7269c57..158f548b935d 100644 --- a/src/legacy/core_plugins/region_map/public/plugin.ts +++ b/src/legacy/core_plugins/region_map/public/plugin.ts @@ -24,7 +24,7 @@ import { UiSettingsClientContract, } from '../../../../core/public'; import { Plugin as DataPublicPlugin } from '../../../../plugins/data/public'; -import { VisualizationsSetup } from '../../visualizations/public/np_ready/public'; +import { VisualizationsSetup } from '../../visualizations/public'; import { LegacyDependenciesPlugin, LegacyDependenciesPluginSetup } from './shim'; diff --git a/src/legacy/core_plugins/region_map/public/region_map_type.js b/src/legacy/core_plugins/region_map/public/region_map_type.js index 9b28aa96eccb..71e949a0612b 100644 --- a/src/legacy/core_plugins/region_map/public/region_map_type.js +++ b/src/legacy/core_plugins/region_map/public/region_map_type.js @@ -25,7 +25,7 @@ import { createRegionMapVisualization } from './region_map_visualization'; import { Status } from 'ui/vis/update_status'; import { RegionMapOptions } from './components/region_map_options'; -import { visFactory } from '../../visualizations/public/np_ready/public'; +import { visFactory } from '../../visualizations/public'; // TODO: reference to TILE_MAP plugin should be removed import { ORIGIN } from '../../tile_map/common/origin'; 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 e32df04a583c..17162278b1e2 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 } from '../../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../../visualizations/public/legacy'; import { createTileMapVisualization } from '../tile_map_visualization'; import { createTileMapTypeDefinition } from '../tile_map_type'; @@ -84,7 +84,7 @@ describe('CoordinateMapsVisualizationTest', function () { $injector, }; - setup.types.registerVisualization(() => createTileMapTypeDefinition(dependencies)); + visualizationsSetup.types.registerVisualization(() => createTileMapTypeDefinition(dependencies)); Vis = Private(visModule.VisProvider); CoordinateMapsVisualization = createTileMapVisualization(dependencies); diff --git a/src/legacy/core_plugins/tile_map/public/legacy.ts b/src/legacy/core_plugins/tile_map/public/legacy.ts index cf2e702cd09b..185dac90bf8a 100644 --- a/src/legacy/core_plugins/tile_map/public/legacy.ts +++ b/src/legacy/core_plugins/tile_map/public/legacy.ts @@ -20,13 +20,13 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as setupVisualizations } from '../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; import { TileMapPluginSetupDependencies } from './plugin'; import { LegacyDependenciesPlugin } from './shim'; import { plugin } from '.'; const plugins: Readonly = { - visualizations: setupVisualizations, + visualizations: visualizationsSetup, data: npSetup.plugins.data, // Temporary solution diff --git a/src/legacy/core_plugins/tile_map/public/plugin.ts b/src/legacy/core_plugins/tile_map/public/plugin.ts index 1309c37a4c73..ba087d5ca595 100644 --- a/src/legacy/core_plugins/tile_map/public/plugin.ts +++ b/src/legacy/core_plugins/tile_map/public/plugin.ts @@ -24,7 +24,7 @@ import { UiSettingsClientContract, } from '../../../../core/public'; import { Plugin as DataPublicPlugin } from '../../../../plugins/data/public'; -import { VisualizationsSetup } from '../../visualizations/public/np_ready/public'; +import { VisualizationsSetup } from '../../visualizations/public'; import { LegacyDependenciesPlugin, LegacyDependenciesPluginSetup } from './shim'; diff --git a/src/legacy/core_plugins/tile_map/public/tile_map_type.js b/src/legacy/core_plugins/tile_map/public/tile_map_type.js index d96d8ad9be78..4c339195173d 100644 --- a/src/legacy/core_plugins/tile_map/public/tile_map_type.js +++ b/src/legacy/core_plugins/tile_map/public/tile_map_type.js @@ -27,7 +27,7 @@ import { colorSchemas } from 'ui/vislib/components/color/truncated_colormaps'; import { convertToGeoJson } from 'ui/vis/map/convert_to_geojson'; import { createTileMapVisualization } from './tile_map_visualization'; -import { visFactory } from '../../visualizations/public/np_ready/public'; +import { visFactory } from '../../visualizations/public'; import { TileMapOptions } from './components/tile_map_options'; import { MapTypes } from './map_types'; 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 539b4e1bdfb4..2552e04fbc9f 100644 --- a/src/legacy/core_plugins/vis_type_markdown/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_markdown/public/legacy.ts @@ -20,12 +20,12 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as setupVisualizations } from '../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; import { MarkdownPluginSetupDependencies } from './plugin'; import { plugin } from '.'; const plugins: Readonly = { - visualizations: setupVisualizations, + visualizations: visualizationsSetup, data: npSetup.plugins.data, }; diff --git a/src/legacy/core_plugins/vis_type_markdown/public/markdown_vis.ts b/src/legacy/core_plugins/vis_type_markdown/public/markdown_vis.ts index 2f1a46f1d8f3..7b2f8f6c236b 100644 --- a/src/legacy/core_plugins/vis_type_markdown/public/markdown_vis.ts +++ b/src/legacy/core_plugins/vis_type_markdown/public/markdown_vis.ts @@ -19,7 +19,7 @@ import { i18n } from '@kbn/i18n'; -import { visFactory, DefaultEditorSize } from '../../visualizations/public/np_ready/public'; +import { visFactory, DefaultEditorSize } from '../../visualizations/public'; import { MarkdownVisWrapper } from './markdown_vis_controller'; import { MarkdownOptions } from './markdown_options'; diff --git a/src/legacy/core_plugins/vis_type_markdown/public/plugin.ts b/src/legacy/core_plugins/vis_type_markdown/public/plugin.ts index 5f9c82ca8929..b013c755168d 100644 --- a/src/legacy/core_plugins/vis_type_markdown/public/plugin.ts +++ b/src/legacy/core_plugins/vis_type_markdown/public/plugin.ts @@ -19,7 +19,7 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../../core/public'; import { Plugin as DataPublicPlugin } from '../../../../plugins/data/public'; -import { VisualizationsSetup } from '../../visualizations/public/np_ready/public'; +import { VisualizationsSetup } from '../../visualizations/public'; import { markdownVis } from './markdown_vis'; import { createMarkdownVisFn } from './markdown_fn'; diff --git a/src/legacy/core_plugins/vis_type_metric/public/__tests__/metric_vis.js b/src/legacy/core_plugins/vis_type_metric/public/__tests__/metric_vis.js index ce77c64d7765..f5fb6312d2b0 100644 --- a/src/legacy/core_plugins/vis_type_metric/public/__tests__/metric_vis.js +++ b/src/legacy/core_plugins/vis_type_metric/public/__tests__/metric_vis.js @@ -24,7 +24,7 @@ import expect from '@kbn/expect'; import { VisProvider } from 'ui/vis'; import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern'; -import { setup as setupVisualizations } from '../../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../../visualizations/public/legacy'; import { createMetricVisTypeDefinition } from '../metric_vis_type'; describe('metric_vis - createMetricVisTypeDefinition', () => { @@ -38,7 +38,7 @@ describe('metric_vis - createMetricVisTypeDefinition', () => { const Vis = Private(VisProvider); const metricVisType = createMetricVisTypeDefinition(); - setupVisualizations.types.registerVisualization(() => metricVisType); + visualizationsSetup.types.registerVisualization(() => metricVisType); const indexPattern = Private(LogstashIndexPatternStubProvider); 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 2eea4c70309d..2ded1a05a8ec 100644 --- a/src/legacy/core_plugins/vis_type_metric/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_metric/public/legacy.ts @@ -20,13 +20,13 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as setupVisualizations } from '../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; import { MetricVisPluginSetupDependencies } from './plugin'; import { LegacyDependenciesPlugin } from './shim'; import { plugin } from '.'; const plugins: Readonly = { - visualizations: setupVisualizations, + visualizations: visualizationsSetup, data: npSetup.plugins.data, // Temporary solution diff --git a/src/legacy/core_plugins/vis_type_metric/public/metric_vis_type.ts b/src/legacy/core_plugins/vis_type_metric/public/metric_vis_type.ts index eba61edeeb84..76e88888ef7f 100644 --- a/src/legacy/core_plugins/vis_type_metric/public/metric_vis_type.ts +++ b/src/legacy/core_plugins/vis_type_metric/public/metric_vis_type.ts @@ -26,7 +26,7 @@ import { vislibColorMaps } from 'ui/vislib/components/color/colormaps'; // @ts-ignore import { MetricVisComponent } from './components/metric_vis_controller'; -import { visFactory } from '../../visualizations/public/np_ready/public'; +import { visFactory } from '../../visualizations/public'; export const createMetricVisTypeDefinition = () => { return visFactory.createReactVisualization({ diff --git a/src/legacy/core_plugins/vis_type_metric/public/plugin.ts b/src/legacy/core_plugins/vis_type_metric/public/plugin.ts index 66a3bb007e37..b8c6001d1f02 100644 --- a/src/legacy/core_plugins/vis_type_metric/public/plugin.ts +++ b/src/legacy/core_plugins/vis_type_metric/public/plugin.ts @@ -20,7 +20,7 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../../core/public'; import { LegacyDependenciesPlugin } from './shim'; import { Plugin as DataPublicPlugin } from '../../../../plugins/data/public'; -import { VisualizationsSetup } from '../../visualizations/public/np_ready/public'; +import { VisualizationsSetup } from '../../visualizations/public'; import { createMetricVisFn } from './metric_vis_fn'; // @ts-ignore 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 9110c8dcb848..f04c953f070a 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 setupVisualizations } from '../../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../../visualizations/public/legacy'; describe('Table Vis - Controller', async function () { let $rootScope; @@ -52,7 +52,7 @@ describe('Table Vis - Controller', async function () { createAngularVisualization: VisFactoryProvider(Private).createAngularVisualization, }; - setupVisualizations.types.registerVisualization(() => + visualizationsSetup.types.registerVisualization(() => createTableVisTypeDefinition(legacyDependencies) ); 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 8521ee729f31..323201ded73a 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 } from '../../../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../../../visualizations/public/legacy'; describe('Table Vis - AggTable Directive', function () { let $rootScope; @@ -107,7 +107,7 @@ describe('Table Vis - AggTable Directive', function () { createAngularVisualization: VisFactoryProvider(Private).createAngularVisualization, }; - setup.types.registerVisualization(() => createTableVisTypeDefinition(legacyDependencies)); + visualizationsSetup.types.registerVisualization(() => createTableVisTypeDefinition(legacyDependencies)); tableAggResponse = legacyResponseHandlerProvider().handler; indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider); diff --git a/src/legacy/core_plugins/vis_type_table/public/agg_table/__tests__/agg_table_group.js b/src/legacy/core_plugins/vis_type_table/public/agg_table/__tests__/agg_table_group.js index 7998a92a4759..77a0ee5221b9 100644 --- a/src/legacy/core_plugins/vis_type_table/public/agg_table/__tests__/agg_table_group.js +++ b/src/legacy/core_plugins/vis_type_table/public/agg_table/__tests__/agg_table_group.js @@ -28,7 +28,7 @@ import { tabifyAggResponse } from 'ui/agg_response/tabify'; import { VisFactoryProvider } from 'ui/vis/vis_factory'; import { createTableVisTypeDefinition } from '../../table_vis_type'; -import { setup } from '../../../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../../../visualizations/public/legacy'; describe('Table Vis - AggTableGroup Directive', function () { let $rootScope; @@ -66,7 +66,7 @@ describe('Table Vis - AggTableGroup Directive', function () { createAngularVisualization: VisFactoryProvider(Private).createAngularVisualization, }; - setup.types.registerVisualization(() => createTableVisTypeDefinition(legacyDependencies)); + visualizationsSetup.types.registerVisualization(() => createTableVisTypeDefinition(legacyDependencies)); tableAggResponse = legacyResponseHandlerProvider().handler; indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider); 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 8139a70552c4..b6d2a4a15292 100644 --- a/src/legacy/core_plugins/vis_type_table/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_table/public/legacy.ts @@ -22,11 +22,11 @@ import { npSetup, npStart } from 'ui/new_platform'; import { plugin } from '.'; import { TablePluginSetupDependencies } from './plugin'; -import { setup as setupVisualizations } from '../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; import { LegacyDependenciesPlugin } from './shim'; const plugins: Readonly = { - visualizations: setupVisualizations, + visualizations: visualizationsSetup, data: npSetup.plugins.data, // Temporary solution diff --git a/src/legacy/core_plugins/vis_type_table/public/plugin.ts b/src/legacy/core_plugins/vis_type_table/public/plugin.ts index 6a39e8079a9f..23f6061ad8f9 100644 --- a/src/legacy/core_plugins/vis_type_table/public/plugin.ts +++ b/src/legacy/core_plugins/vis_type_table/public/plugin.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { VisualizationsSetup } from '../../visualizations/public/np_ready/public'; +import { VisualizationsSetup } from '../../visualizations/public'; import { Plugin as DataPublicPlugin } from '../../../../plugins/data/public'; import { 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 6a5e06b6e697..dd2c21fe6477 100644 --- a/src/legacy/core_plugins/vis_type_tagcloud/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_tagcloud/public/legacy.ts @@ -20,12 +20,12 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as setupVisualizations } from '../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; import { TagCloudPluginSetupDependencies } from './plugin'; import { plugin } from '.'; const plugins: Readonly = { - visualizations: setupVisualizations, + visualizations: visualizationsSetup, data: npSetup.plugins.data, }; diff --git a/src/legacy/core_plugins/vis_type_tagcloud/public/plugin.ts b/src/legacy/core_plugins/vis_type_tagcloud/public/plugin.ts index e13e9896e394..3947521a9868 100644 --- a/src/legacy/core_plugins/vis_type_tagcloud/public/plugin.ts +++ b/src/legacy/core_plugins/vis_type_tagcloud/public/plugin.ts @@ -19,7 +19,7 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../../core/public'; import { Plugin as DataPublicPlugin } from '../../../../plugins/data/public'; -import { VisualizationsSetup } from '../../visualizations/public/np_ready/public'; +import { VisualizationsSetup } from '../../visualizations/public'; import { createTagCloudFn } from './tag_cloud_fn'; import { createTagCloudTypeDefinition } from './tag_cloud_type'; diff --git a/src/legacy/core_plugins/vis_type_tagcloud/public/tag_cloud_type.ts b/src/legacy/core_plugins/vis_type_tagcloud/public/tag_cloud_type.ts index 421821d93b04..0b4d90522cc4 100644 --- a/src/legacy/core_plugins/vis_type_tagcloud/public/tag_cloud_type.ts +++ b/src/legacy/core_plugins/vis_type_tagcloud/public/tag_cloud_type.ts @@ -23,7 +23,7 @@ import { Status } from 'ui/vis/update_status'; import { Schemas } from 'ui/vis/editors/default/schemas'; import { TagCloudOptions } from './components/tag_cloud_options'; -import { visFactory } from '../../visualizations/public/np_ready/public'; +import { visFactory } from '../../visualizations/public'; // @ts-ignore import { TagCloudVisualization } from './components/tag_cloud_visualization'; 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 8dc24503772d..79cfb1b164f0 100644 --- a/src/legacy/core_plugins/vis_type_timeseries/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_timeseries/public/legacy.ts @@ -20,12 +20,12 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as setupVisualizations } from '../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; import { MetricsPluginSetupDependencies } from './plugin'; import { plugin } from '.'; const plugins: Readonly = { - visualizations: setupVisualizations, + visualizations: visualizationsSetup, data: npSetup.plugins.data, }; diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/metrics_type.ts b/src/legacy/core_plugins/vis_type_timeseries/public/metrics_type.ts index fd00f95b1e00..b2f9269f852f 100644 --- a/src/legacy/core_plugins/vis_type_timeseries/public/metrics_type.ts +++ b/src/legacy/core_plugins/vis_type_timeseries/public/metrics_type.ts @@ -22,7 +22,7 @@ import { i18n } from '@kbn/i18n'; // @ts-ignore import { defaultFeedbackMessage } from 'ui/vis/default_feedback_message'; -import { visFactory } from '../../visualizations/public/np_ready/public'; +import { visFactory } from '../../visualizations/public'; // @ts-ignore import { createMetricsRequestHandler } from './request_handler'; diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/plugin.ts b/src/legacy/core_plugins/vis_type_timeseries/public/plugin.ts index 5c103a3ae4b0..673bd202b70f 100644 --- a/src/legacy/core_plugins/vis_type_timeseries/public/plugin.ts +++ b/src/legacy/core_plugins/vis_type_timeseries/public/plugin.ts @@ -18,7 +18,7 @@ */ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../../core/public'; import { Plugin as DataPublicPlugin } from '../../../../plugins/data/public'; -import { VisualizationsSetup } from '../../visualizations/public/np_ready/public'; +import { VisualizationsSetup } from '../../visualizations/public'; import { createMetricsFn } from './metrics_fn'; import { createMetricsTypeDefinition } from './metrics_type'; 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 012f144983e9..9c46dfb9451f 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 } from '../../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../../visualizations/public/legacy'; import { createVegaTypeDefinition } from '../vega_type'; const THRESHOLD = 0.1; @@ -65,7 +65,7 @@ describe('VegaVisualizations', () => { uiSettings: $injector.get('config'), }; - setup.types.registerVisualization(() => + visualizationsSetup.types.registerVisualization(() => createVegaTypeDefinition(vegaVisualizationDependencies) ); 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 15cf97beb571..ded1e773ac07 100644 --- a/src/legacy/core_plugins/vis_type_vega/public/legacy.ts +++ b/src/legacy/core_plugins/vis_type_vega/public/legacy.ts @@ -20,13 +20,13 @@ import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { setup as setupVisualizations } from '../../visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../visualizations/public/legacy'; import { VegaPluginSetupDependencies } from './plugin'; import { LegacyDependenciesPlugin } from './shim'; import { plugin } from '.'; const plugins: Readonly = { - visualizations: setupVisualizations, + visualizations: visualizationsSetup, data: npSetup.plugins.data, // Temporary solution diff --git a/src/legacy/core_plugins/vis_type_vega/public/plugin.ts b/src/legacy/core_plugins/vis_type_vega/public/plugin.ts index b2a6fade883c..4d90b360bdb6 100644 --- a/src/legacy/core_plugins/vis_type_vega/public/plugin.ts +++ b/src/legacy/core_plugins/vis_type_vega/public/plugin.ts @@ -25,7 +25,7 @@ import { } from '../../../../core/public'; import { LegacyDependenciesPlugin, LegacyDependenciesPluginSetup } from './shim'; import { Plugin as DataPublicPlugin } from '../../../../plugins/data/public'; -import { VisualizationsSetup } from '../../visualizations/public/np_ready/public'; +import { VisualizationsSetup } from '../../visualizations/public'; import { createVegaFn } from './vega_fn'; import { createVegaTypeDefinition } from './vega_type'; diff --git a/src/legacy/core_plugins/vis_type_vega/public/vega_type.ts b/src/legacy/core_plugins/vis_type_vega/public/vega_type.ts index d1f04c794e3c..6ffcd8867ffe 100644 --- a/src/legacy/core_plugins/vis_type_vega/public/vega_type.ts +++ b/src/legacy/core_plugins/vis_type_vega/public/vega_type.ts @@ -25,7 +25,7 @@ import { DefaultEditorSize } from 'ui/vis/editor_size'; import { defaultFeedbackMessage } from 'ui/vis/default_feedback_message'; import vegaEditorTemplate from './vega_editor_template.html'; -import { visFactory } from '../../visualizations/public/np_ready/public'; +import { visFactory } from '../../visualizations/public'; import { VegaVisualizationDependencies } from './plugin'; import { createVegaRequestHandler } from './vega_request_handler'; diff --git a/src/legacy/core_plugins/visualizations/index.ts b/src/legacy/core_plugins/visualizations/index.ts index 3642071667f4..bb9ef1588bdc 100644 --- a/src/legacy/core_plugins/visualizations/index.ts +++ b/src/legacy/core_plugins/visualizations/index.ts @@ -25,7 +25,7 @@ export default function VisualizationsPlugin(kibana: any) { const config: Legacy.PluginSpecOptions = { id: 'visualizations', require: ['data'], - publicDir: resolve(__dirname, 'public/np_ready/public'), + publicDir: resolve(__dirname, 'public'), config: (Joi: any) => { return Joi.object({ enabled: Joi.boolean().default(true), diff --git a/src/legacy/core_plugins/visualizations/public/index.ts b/src/legacy/core_plugins/visualizations/public/index.ts new file mode 100644 index 000000000000..eb93bb9b419e --- /dev/null +++ b/src/legacy/core_plugins/visualizations/public/index.ts @@ -0,0 +1,57 @@ +/* + * 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. + */ + +/** + * Static legacy code which hasn't been moved to this plugin yet, but + * should be eventually. + * + * @public + */ +// @ts-ignore Used only by tsvb, vega, input control vis +export { defaultFeedbackMessage } from 'ui/vis/default_feedback_message'; +// @ts-ignore +export { visFactory } from 'ui/vis/vis_factory'; +// @ts-ignore +export { DefaultEditorSize } from 'ui/vis/editor_size'; + +/** + * Legacy types which haven't been moved to this plugin yet, but + * should be eventually. + * + * @public + */ +import * as types from 'ui/vis/vis'; +export type Vis = types.Vis; +export type VisParams = types.VisParams; +export type VisProvider = types.VisProvider; +export type VisState = types.VisState; +export { VisualizationController, VisType } from 'ui/vis/vis_types/vis_type'; +export { VisTypesRegistry } from 'ui/registry/vis_types'; +export { Status } from 'ui/vis/update_status'; + +/** + * Static np-ready code, re-exported here so consumers can import from + * `src/legacy/core_plugins/visualizations/public` + * + * @public + */ +export * from './np_ready'; + +// for backwards compatibility with 7.3 +export { setup as visualizations } from './legacy'; diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/public/legacy.ts b/src/legacy/core_plugins/visualizations/public/legacy.ts similarity index 58% rename from src/legacy/core_plugins/visualizations/public/np_ready/public/legacy.ts rename to src/legacy/core_plugins/visualizations/public/legacy.ts index 04a49294bd0c..3dd31f624c4a 100644 --- a/src/legacy/core_plugins/visualizations/public/np_ready/public/legacy.ts +++ b/src/legacy/core_plugins/visualizations/public/legacy.ts @@ -16,24 +16,37 @@ * specific language governing permissions and limitations * under the License. */ -/* eslint-disable @kbn/eslint/no-restricted-paths */ + +/** + * 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'; import { npSetup, npStart } from 'ui/new_platform'; // @ts-ignore import { VisFiltersProvider, createFilter } from 'ui/vis/vis_filters'; // @ts-ignore -import { defaultFeedbackMessage } from 'ui/vis/default_feedback_message'; -// @ts-ignore import { VisProvider as Vis } from 'ui/vis/index.js'; // @ts-ignore import { VisFactoryProvider } from 'ui/vis/vis_factory'; import { VisTypesRegistryProvider } from 'ui/registry/vis_types'; -/* eslint-enable @kbn/eslint/no-restricted-paths */ - -import { visTypeAliasRegistry } from './types/vis_type_alias_registry'; import { plugin } from '.'; -const pluginInstance = plugin({} as any); +const pluginInstance = plugin({} as PluginInitializerContext); export const setup = pluginInstance.setup(npSetup.core, { __LEGACY: { @@ -43,8 +56,6 @@ export const setup = pluginInstance.setup(npSetup.core, { Vis, VisFactoryProvider, VisTypesRegistryProvider, - defaultFeedbackMessage, - visTypeAliasRegistry, }, }); -export const start = pluginInstance.start(npStart.core); +export const start = pluginInstance.start(npStart.core, {}); diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/public/mocks.ts b/src/legacy/core_plugins/visualizations/public/mocks.ts similarity index 72% rename from src/legacy/core_plugins/visualizations/public/np_ready/public/mocks.ts rename to src/legacy/core_plugins/visualizations/public/mocks.ts index df5e4d25dedc..5cfe78fc2fa3 100644 --- a/src/legacy/core_plugins/visualizations/public/np_ready/public/mocks.ts +++ b/src/legacy/core_plugins/visualizations/public/mocks.ts @@ -17,7 +17,6 @@ * under the License. */ -/* eslint-disable @kbn/eslint/no-restricted-paths */ jest.mock('ui/vis/vis_filters'); jest.mock('ui/vis/default_feedback_message'); jest.mock('ui/vis/index.js'); @@ -26,23 +25,18 @@ jest.mock('ui/registry/vis_types'); // @ts-ignore import { VisFiltersProvider, createFilter } from 'ui/vis/vis_filters'; // @ts-ignore -import { defaultFeedbackMessage } from 'ui/vis/default_feedback_message'; -// @ts-ignore import { VisProvider as Vis } from 'ui/vis/index.js'; // @ts-ignore import { VisFactoryProvider } from 'ui/vis/vis_factory'; import { VisTypesRegistryProvider } from 'ui/registry/vis_types'; -/* eslint-enable @kbn/eslint/no-restricted-paths */ jest.mock('./types/vis_type_alias_registry'); -import { visTypeAliasRegistry } from './types/vis_type_alias_registry'; - -import { Plugin } from '.'; -import { coreMock } from '../../../../../../core/public/mocks'; +import { PluginInitializerContext } from 'src/core/public'; -export type Setup = jest.Mocked>; -export type Start = jest.Mocked>; +import { VisualizationsSetup, VisualizationsStart } from './'; +import { VisualizationsPlugin } from './np_ready/plugin'; +import { coreMock } from '../../../../core/public/mocks'; -const createSetupContract = (): Setup => ({ +const createSetupContract = (): VisualizationsSetup => ({ filters: { VisFiltersProvider: jest.fn(), createFilter: jest.fn(), @@ -51,7 +45,6 @@ const createSetupContract = (): Setup => ({ Vis, VisFactoryProvider: jest.fn(), registerVisualization: jest.fn(), - defaultFeedbackMessage, visTypeAliasRegistry: { add: jest.fn(), get: jest.fn(), @@ -59,10 +52,10 @@ const createSetupContract = (): Setup => ({ }, }); -const createStartContract = (): Start => {}; +const createStartContract = (): VisualizationsStart => ({}); const createInstance = () => { - const plugin = new Plugin({} as any); + const plugin = new VisualizationsPlugin({} as PluginInitializerContext); const setup = plugin.setup(coreMock.createSetup(), { __LEGACY: { @@ -72,11 +65,9 @@ const createInstance = () => { Vis, VisFactoryProvider, VisTypesRegistryProvider, - defaultFeedbackMessage, - visTypeAliasRegistry, }, }); - const doStart = () => plugin.start(coreMock.createStart()); + const doStart = () => plugin.start(coreMock.createStart(), {}); return { plugin, diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/public/filters/filters_service.ts b/src/legacy/core_plugins/visualizations/public/np_ready/filters/filters_service.ts similarity index 100% rename from src/legacy/core_plugins/visualizations/public/np_ready/public/filters/filters_service.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/filters/filters_service.ts diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/public/filters/index.ts b/src/legacy/core_plugins/visualizations/public/np_ready/filters/index.ts similarity index 92% rename from src/legacy/core_plugins/visualizations/public/np_ready/public/filters/index.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/filters/index.ts index 591f7c9bc771..480796c37717 100644 --- a/src/legacy/core_plugins/visualizations/public/np_ready/public/filters/index.ts +++ b/src/legacy/core_plugins/visualizations/public/np_ready/filters/index.ts @@ -17,4 +17,4 @@ * under the License. */ -export { FiltersService, FiltersSetup } from './filters_service'; +export * from './filters_service'; diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/public/index.ts b/src/legacy/core_plugins/visualizations/public/np_ready/index.ts similarity index 53% rename from src/legacy/core_plugins/visualizations/public/np_ready/public/index.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/index.ts index d38acaa3cf3f..38b6a3212535 100644 --- a/src/legacy/core_plugins/visualizations/public/np_ready/public/index.ts +++ b/src/legacy/core_plugins/visualizations/public/np_ready/index.ts @@ -17,29 +17,30 @@ * under the License. */ +/** + * Visualizations Plugin - public + * + * This is the entry point for the entire client-side public contract of the plugin. + * If something is not explicitly exported here, you can safely assume it is private + * to the plugin and not considered stable. + * + * All stateful contracts will be injected by the platform at runtime, and are defined + * 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 { VisualizationsPublicPlugin, Setup } from './plugin'; +import { VisualizationsPlugin, VisualizationsSetup, VisualizationsStart } from './plugin'; /** @public */ -export type VisualizationsSetup = Setup; +export type VisualizationsSetup = VisualizationsSetup; +export type VisualizationsStart = VisualizationsStart; /** @public types */ -export { - Vis, - visFactory, - DefaultEditorSize, - VisParams, - VisProvider, - VisState, - // VisualizationController, - // VisType, - VisTypeAlias, - VisTypesRegistry, - Status, -} from './types'; +export { VisTypeAlias } from './types'; export function plugin(initializerContext: PluginInitializerContext) { - return new VisualizationsPublicPlugin(initializerContext); + return new VisualizationsPlugin(initializerContext); } -export { VisualizationsPublicPlugin as Plugin }; +/** @public static code */ +// TODO once items are moved from ui/vis into this service diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/kibana.json b/src/legacy/core_plugins/visualizations/public/np_ready/kibana.json deleted file mode 100644 index 8ecf3dfce6e9..000000000000 --- a/src/legacy/core_plugins/visualizations/public/np_ready/kibana.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "visualizations", - "version": "kibana", - "requiredPlugins": [ - ], - "server": false, - "ui": true - } - \ No newline at end of file diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/public/plugin.ts b/src/legacy/core_plugins/visualizations/public/np_ready/plugin.ts similarity index 53% rename from src/legacy/core_plugins/visualizations/public/np_ready/public/plugin.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/plugin.ts index abf5974b7753..90ca5fc79175 100644 --- a/src/legacy/core_plugins/visualizations/public/np_ready/public/plugin.ts +++ b/src/legacy/core_plugins/visualizations/public/np_ready/plugin.ts @@ -20,9 +20,13 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core import { FiltersService, FiltersSetup } from './filters'; import { TypesService, TypesSetup } from './types'; -import { VisTypeAliasRegistry } from './types/vis_type_alias_registry'; -interface SetupDependencies { +/** + * Interface for any dependencies on other plugins' contracts. + * + * @internal + */ +interface VisualizationsPluginSetupDependencies { __LEGACY: { VisFiltersProvider: any; createFilter: any; @@ -30,36 +34,53 @@ interface SetupDependencies { Vis: any; VisFactoryProvider: any; VisTypesRegistryProvider: any; - defaultFeedbackMessage: any; - visTypeAliasRegistry: VisTypeAliasRegistry; }; } -export interface Setup { +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface VisualizationsPluginStartDependencies {} + +/** + * Interface for this plugin's returned setup/start contracts. + * + * @public + */ +export interface VisualizationsSetup { filters: FiltersSetup; types: TypesSetup; } -export type Start = void; +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface VisualizationsStart {} -export class VisualizationsPublicPlugin implements Plugin { - private readonly filters: FiltersService; - private readonly types: TypesService; +/** + * Visualizations Plugin - public + * + * This plugin's stateful contracts are returned from the `setup` and `start` methods + * below. The interfaces for these contracts are provided above. + * + * @internal + */ +export class VisualizationsPlugin + implements + Plugin< + VisualizationsSetup, + VisualizationsStart, + VisualizationsPluginSetupDependencies, + VisualizationsPluginStartDependencies + > { + private readonly filters: FiltersService = new FiltersService(); + private readonly types: TypesService = new TypesService(); - constructor(initializerContext: PluginInitializerContext) { - this.filters = new FiltersService(); - this.types = new TypesService(); - } + constructor(initializerContext: PluginInitializerContext) {} - public setup(core: CoreSetup, { __LEGACY }: SetupDependencies) { + public setup(core: CoreSetup, { __LEGACY }: VisualizationsPluginSetupDependencies) { const { VisFiltersProvider, createFilter, Vis, VisFactoryProvider, VisTypesRegistryProvider, - defaultFeedbackMessage, - visTypeAliasRegistry, } = __LEGACY; return { @@ -67,18 +88,12 @@ export class VisualizationsPublicPlugin implements Plugin any) => { VisTypesRegistryProvider.register(registerFn); }, - defaultFeedbackMessage, // make default in base vis type, or move? visTypeAliasRegistry, }; } @@ -64,17 +47,11 @@ export class TypesService { } } -/** @public */ +/** @internal */ export type TypesSetup = ReturnType; -export { visFactory, DefaultEditorSize }; - /** @public types */ export type VisTypeAlias = VisTypeAlias; -export type Vis = types.Vis; -export type VisParams = types.VisParams; -export type VisProvider = types.VisProvider; -export type VisState = types.VisState; -// todo: this breaks it // export { VisualizationController, VisType } from 'ui/vis/vis_types/vis_type'; -export { VisTypesRegistry } from 'ui/registry/vis_types'; -export { Status } from 'ui/vis/update_status'; + +/** @public static code */ +// TODO once items are moved from ui/vis into this service diff --git a/src/legacy/core_plugins/visualizations/public/np_ready/public/types/vis_type_alias_registry.ts b/src/legacy/core_plugins/visualizations/public/np_ready/types/vis_type_alias_registry.ts similarity index 91% rename from src/legacy/core_plugins/visualizations/public/np_ready/public/types/vis_type_alias_registry.ts rename to src/legacy/core_plugins/visualizations/public/np_ready/types/vis_type_alias_registry.ts index eb84f93a0d3b..f982d1ed3ca2 100644 --- a/src/legacy/core_plugins/visualizations/public/np_ready/public/types/vis_type_alias_registry.ts +++ b/src/legacy/core_plugins/visualizations/public/np_ready/types/vis_type_alias_registry.ts @@ -17,7 +17,7 @@ * under the License. */ -export interface VisualizationListItem { +interface VisualizationListItem { editUrl: string; icon: string; id: string; @@ -27,7 +27,7 @@ export interface VisualizationListItem { typeTitle: string; } -export interface VisualizationsAppExtension { +interface VisualizationsAppExtension { docTypes: string[]; searchFields?: string[]; toListItem: (savedObject: { @@ -52,14 +52,14 @@ export interface VisTypeAlias { const registry: VisTypeAlias[] = []; -export interface VisTypeAliasRegistry { +interface VisTypeAliasRegistry { get: () => VisTypeAlias[]; add: (newVisTypeAlias: VisTypeAlias) => void; } export const visTypeAliasRegistry: VisTypeAliasRegistry = { get: () => [...registry], - add: (newVisTypeAlias: VisTypeAlias) => { + add: newVisTypeAlias => { if (registry.find(visTypeAlias => visTypeAlias.name === newVisTypeAlias.name)) { throw new Error(`${newVisTypeAlias.name} already registered`); } 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 0799e59bbb01..8a103a554f7f 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,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { setup } from '../../../../../src/legacy/core_plugins/visualizations/public/np_ready/public/legacy'; +import { setup as visualizationsSetup } from '../../../../../src/legacy/core_plugins/visualizations/public/legacy'; import { i18n } from '@kbn/i18n'; import { APP_ID, APP_ICON, MAP_BASE_URL } from '../common/constants'; -setup.types.visTypeAliasRegistry.add({ +visualizationsSetup.types.visTypeAliasRegistry.add({ aliasUrl: MAP_BASE_URL, name: APP_ID, title: i18n.translate('xpack.maps.visTypeAlias.title', {