Skip to content

Commit

Permalink
visualizations πŸ‘‰ NP-ready (#47142) (#47452)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
streamich authored Oct 7, 2019
1 parent 2130013 commit a36f27c
Show file tree
Hide file tree
Showing 52 changed files with 64 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/region_map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/region_map/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 '.';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/tile_map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/tile_map/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 '.';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/timelion/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/timelion/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_markdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_markdown/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 '.';

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_metric/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_metric/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 '.';
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_table/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TablePluginSetupDependencies> = {
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_tagcloud/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_tagcloud/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 '.';

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_timeseries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 '.';

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_vega/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_vega/public/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 '.';
Expand Down
38 changes: 0 additions & 38 deletions src/legacy/core_plugins/visualizations/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/core_plugins/visualizations/package.json

This file was deleted.

4 changes: 2 additions & 2 deletions src/legacy/core_plugins/visualizations/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
10 changes: 10 additions & 0 deletions src/legacy/core_plugins/visualizations/public/np_ready/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "visualizations",
"version": "kibana",
"server": false,
"ui": true,
"requiredPlugins": [
"data",
"search"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Loading

0 comments on commit a36f27c

Please sign in to comment.