From 7c993f5a6abb1a09a9199f4da5e2e96184f4a0e1 Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 12:06:42 +0200 Subject: [PATCH 01/14] =?UTF-8?q?chore:=20=F0=9F=A4=96=20move=20embeddable?= =?UTF-8?q?=5Fapi=20to=20NP=20"embeddable"=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core_plugins/embeddable_api/README.md | 41 +------------------ .../embeddable_api/public/index.scss | 4 +- .../public/np_ready/public/legacy.ts | 28 ------------- src/plugins/embeddable/README.md | 39 ++++++++++++++++++ .../embeddable}/kibana.json | 1 - .../public/api/get_embeddable_factories.ts | 0 .../public/api/get_embeddable_factory.ts | 0 .../embeddable}/public/api/index.ts | 0 .../public/api/register_embeddable_factory.ts | 0 .../embeddable}/public/api/tests/helpers.ts | 0 .../public/api/tests/registry.test.ts | 0 .../embeddable}/public/api/types.ts | 0 .../embeddable}/public/bootstrap.ts | 0 .../embeddable}/public/index.ts | 0 .../lib/actions/apply_filter_action.test.ts | 0 .../public/lib/actions/apply_filter_action.ts | 6 +-- .../lib/actions/edit_panel_action.test.tsx | 0 .../public/lib/actions/edit_panel_action.ts | 0 .../embeddable}/public/lib/actions/index.ts | 0 .../public/lib/containers/container.ts | 0 .../embeddable_child_panel.test.tsx | 2 +- .../lib/containers/embeddable_child_panel.tsx | 2 +- .../public/lib/containers/i_container.ts | 0 .../public/lib/containers/index.ts | 0 .../lib/embeddables/embeddable.test.tsx | 0 .../public/lib/embeddables/embeddable.tsx | 0 .../lib/embeddables/embeddable_factory.ts | 0 .../lib/embeddables/error_embeddable.tsx | 0 .../public/lib/embeddables/i_embeddable.ts | 0 .../public/lib/embeddables/index.ts | 0 .../embeddable}/public/lib/errors.test.ts | 0 .../embeddable}/public/lib/errors.ts | 0 .../embeddable}/public/lib/index.ts | 0 .../public/lib/panel/_embeddable_panel.scss | 0 .../embeddable}/public/lib/panel/_index.scss | 0 .../lib/panel/embeddable_panel.test.tsx | 2 +- .../public/lib/panel/embeddable_panel.tsx | 6 +-- .../embeddable}/public/lib/panel/index.ts | 0 .../public/lib/panel/panel_header/_index.scss | 0 .../_panel_options_menu_form.scss | 0 .../public/lib/panel/panel_header/index.ts | 0 .../add_panel/add_panel_action.test.tsx | 3 +- .../add_panel/add_panel_action.ts | 4 +- .../add_panel/add_panel_flyout.test.tsx | 2 +- .../add_panel/add_panel_flyout.tsx | 0 .../panel_actions/add_panel/index.ts | 0 .../add_panel/open_add_panel_flyout.tsx | 4 +- .../customize_panel_action.test.ts | 0 .../customize_title/customize_panel_action.ts | 0 .../customize_title/customize_panel_modal.tsx | 0 .../customize_title/customize_title_form.tsx | 0 .../panel/panel_header/panel_actions/index.ts | 0 .../inspect_panel_action.test.tsx | 2 +- .../panel_actions/inspect_panel_action.ts | 4 +- .../remove_panel_action.test.tsx | 0 .../panel_actions/remove_panel_action.ts | 5 +-- .../lib/panel/panel_header/panel_header.tsx | 10 ++--- .../panel/panel_header/panel_options_menu.tsx | 0 .../test_samples/actions/edit_mode_action.ts | 2 +- .../actions/get_message_modal.tsx | 0 .../public/lib/test_samples/actions/index.ts | 0 .../test_samples/actions/say_hello_action.tsx | 5 +-- .../actions/send_message_action.tsx | 7 +--- .../embeddables/contact_card/contact_card.tsx | 0 .../contact_card/contact_card_embeddable.tsx | 0 .../contact_card_embeddable_factory.tsx | 2 +- .../contact_card/contact_card_initializer.tsx | 0 .../embeddables/contact_card/index.ts | 0 .../slow_contact_card_embeddable_factory.ts | 0 .../embeddables/empty_embeddable.tsx | 0 .../embeddables/filterable_container.tsx | 0 .../filterable_container_factory.ts | 0 .../embeddables/filterable_embeddable.tsx | 0 .../filterable_embeddable_factory.ts | 0 .../hello_world/hello_world_embeddable.tsx | 0 .../hello_world_embeddable_factory.ts | 0 .../embeddables/hello_world/index.ts | 0 .../embeddables/hello_world_container.tsx | 2 +- .../hello_world_container_component.tsx | 0 .../lib/test_samples/embeddables/index.ts | 0 .../public/lib/test_samples/index.ts | 0 .../embeddable}/public/lib/triggers/index.ts | 0 .../embeddable}/public/lib/types.ts | 2 +- .../embeddable}/public/mocks.ts | 4 +- .../embeddable}/public/plugin.ts | 7 +--- .../public/tests/apply_filter_action.test.ts | 2 +- .../public/tests/container.test.ts | 3 +- .../tests/customize_panel_modal.test.tsx | 3 +- .../public/tests/explicit_input.test.ts | 2 +- .../tests/get_embeddable_factories.test.ts | 0 .../embeddable}/public/tests/helpers.ts | 0 .../embeddable}/public/tests/test_plugin.ts | 0 .../embeddable}/public/types.ts | 0 93 files changed, 80 insertions(+), 126 deletions(-) delete mode 100644 src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.ts create mode 100644 src/plugins/embeddable/README.md rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/kibana.json (87%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/api/get_embeddable_factories.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/api/get_embeddable_factory.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/api/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/api/register_embeddable_factory.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/api/tests/helpers.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/api/tests/registry.test.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/api/types.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/bootstrap.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/actions/apply_filter_action.test.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/actions/apply_filter_action.ts (94%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/actions/edit_panel_action.test.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/actions/edit_panel_action.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/actions/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/containers/container.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/containers/embeddable_child_panel.test.tsx (97%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/containers/embeddable_child_panel.tsx (97%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/containers/i_container.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/containers/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/embeddables/embeddable.test.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/embeddables/embeddable.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/embeddables/embeddable_factory.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/embeddables/error_embeddable.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/embeddables/i_embeddable.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/embeddables/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/errors.test.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/errors.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/_embeddable_panel.scss (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/_index.scss (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/embeddable_panel.test.tsx (99%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/embeddable_panel.tsx (97%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/_index.scss (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/_panel_options_menu_form.scss (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx (98%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts (93%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx (98%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/add_panel/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx (90%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx (98%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/inspect_panel_action.ts (92%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/remove_panel_action.test.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts (95%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_header.tsx (88%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/panel/panel_header/panel_options_menu.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/actions/edit_mode_action.ts (93%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/actions/get_message_modal.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/actions/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/actions/say_hello_action.tsx (96%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/actions/send_message_action.tsx (92%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/contact_card/contact_card.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx (97%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/contact_card/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/empty_embeddable.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/filterable_container.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/filterable_container_factory.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/filterable_embeddable.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/filterable_embeddable_factory.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable_factory.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/hello_world/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/hello_world_container.tsx (96%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/hello_world_container_component.tsx (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/embeddables/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/test_samples/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/triggers/index.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/lib/types.ts (95%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/mocks.ts (92%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/plugin.ts (94%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/tests/apply_filter_action.test.ts (98%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/tests/container.test.ts (99%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/tests/customize_panel_modal.test.tsx (98%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/tests/explicit_input.test.ts (98%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/tests/get_embeddable_factories.test.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/tests/helpers.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/tests/test_plugin.ts (100%) rename src/{legacy/core_plugins/embeddable_api/public/np_ready => plugins/embeddable}/public/types.ts (100%) diff --git a/src/legacy/core_plugins/embeddable_api/README.md b/src/legacy/core_plugins/embeddable_api/README.md index 1fe91f426f43f..c2f67572df873 100644 --- a/src/legacy/core_plugins/embeddable_api/README.md +++ b/src/legacy/core_plugins/embeddable_api/README.md @@ -1,39 +1,2 @@ -# The Embeddable API V2 - -The Embeddable API's main goal is to have documented and standardized ways to share and exchange information and functionality across applications and plugins. - -There are three main pieces of this infrastructure: - - Embeddables & Containers - - Actions - - Triggers - -## Embeddables & Containers - -Embeddables are isolated, serializable, renderable widgets. A developer can hard code an embeddable inside their -application, or they can use some built in actions to allow users to dynamically add them to *containers*. - -Containers are a special type of embeddable that can contain nested embeddables. - -## Actions - -Actions are pluggable pieces of functionality exposed to the user that take an embeddable as context, plus an optional action context. - -## Triggers - -Triggers are the way actions are connected to a user action. We ship with two default triggers, `CONTEXT_MENU_TRIGGER` and `APPLY_FILTER`. - -Actions attached to the `CONTEXT_MENU_TRIGGER` will be displayed in supported embeddables context menu to the user. Actions attached to the `APPLY_FILTER` trigger will show up when any embeddable emits this trigger. - -A developer can register new triggers that their embeddables, or external components, can emit (as long as they have an embeddable to pass along as context). - -## Examples - -Many examples can be viewed in the functionally tested `kbn_tp_embeddable_explorer` plugin, as well as the jest tested classes inside the `embeddable_api/public/test_samples` folder. - -## Testing - -Run unit tests - -```shell -node scripts/jest embeddable_api -``` +- Embeddables have been moved to `/src/plugins/embeddable` NP plugin. +- This legacy plugin is still there to make necessary CSS working, but soon will be completely deleted. diff --git a/src/legacy/core_plugins/embeddable_api/public/index.scss b/src/legacy/core_plugins/embeddable_api/public/index.scss index a9995ab11ad9e..b4e170e6cb65c 100644 --- a/src/legacy/core_plugins/embeddable_api/public/index.scss +++ b/src/legacy/core_plugins/embeddable_api/public/index.scss @@ -1,5 +1,5 @@ @import 'src/legacy/ui/public/styles/styling_constants'; @import './variables'; -@import './np_ready/public/lib/panel/index'; -@import './np_ready/public/lib/panel/panel_header/index'; +@import '../../../../plugins/embeddable/public/lib/panel/index'; +@import '../../../../plugins/embeddable/public/lib/panel/panel_header/index'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.ts b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.ts deleted file mode 100644 index 00672edc20500..0000000000000 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.ts +++ /dev/null @@ -1,28 +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. - */ - -/* eslint-disable @kbn/eslint/no-restricted-paths */ -import { npSetup, npStart } from 'ui/new_platform'; -/* eslint-enable @kbn/eslint/no-restricted-paths */ - -import { plugin } from '.'; - -const pluginInstance = plugin({} as any); -export const setup = pluginInstance.setup(npSetup.core, { uiActions: npSetup.plugins.uiActions }); -export const start = pluginInstance.start(npStart.core); diff --git a/src/plugins/embeddable/README.md b/src/plugins/embeddable/README.md new file mode 100644 index 0000000000000..1fe91f426f43f --- /dev/null +++ b/src/plugins/embeddable/README.md @@ -0,0 +1,39 @@ +# The Embeddable API V2 + +The Embeddable API's main goal is to have documented and standardized ways to share and exchange information and functionality across applications and plugins. + +There are three main pieces of this infrastructure: + - Embeddables & Containers + - Actions + - Triggers + +## Embeddables & Containers + +Embeddables are isolated, serializable, renderable widgets. A developer can hard code an embeddable inside their +application, or they can use some built in actions to allow users to dynamically add them to *containers*. + +Containers are a special type of embeddable that can contain nested embeddables. + +## Actions + +Actions are pluggable pieces of functionality exposed to the user that take an embeddable as context, plus an optional action context. + +## Triggers + +Triggers are the way actions are connected to a user action. We ship with two default triggers, `CONTEXT_MENU_TRIGGER` and `APPLY_FILTER`. + +Actions attached to the `CONTEXT_MENU_TRIGGER` will be displayed in supported embeddables context menu to the user. Actions attached to the `APPLY_FILTER` trigger will show up when any embeddable emits this trigger. + +A developer can register new triggers that their embeddables, or external components, can emit (as long as they have an embeddable to pass along as context). + +## Examples + +Many examples can be viewed in the functionally tested `kbn_tp_embeddable_explorer` plugin, as well as the jest tested classes inside the `embeddable_api/public/test_samples` folder. + +## Testing + +Run unit tests + +```shell +node scripts/jest embeddable_api +``` diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/kibana.json b/src/plugins/embeddable/kibana.json similarity index 87% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/kibana.json rename to src/plugins/embeddable/kibana.json index 54c1d1b640c98..d5cd7957b856a 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/kibana.json +++ b/src/plugins/embeddable/kibana.json @@ -4,7 +4,6 @@ "server": false, "ui": true, "requiredPlugins": [ - "embeddable", "inspector" ] } diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/get_embeddable_factories.ts b/src/plugins/embeddable/public/api/get_embeddable_factories.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/get_embeddable_factories.ts rename to src/plugins/embeddable/public/api/get_embeddable_factories.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/get_embeddable_factory.ts b/src/plugins/embeddable/public/api/get_embeddable_factory.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/get_embeddable_factory.ts rename to src/plugins/embeddable/public/api/get_embeddable_factory.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/index.ts b/src/plugins/embeddable/public/api/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/index.ts rename to src/plugins/embeddable/public/api/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/register_embeddable_factory.ts b/src/plugins/embeddable/public/api/register_embeddable_factory.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/register_embeddable_factory.ts rename to src/plugins/embeddable/public/api/register_embeddable_factory.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/tests/helpers.ts b/src/plugins/embeddable/public/api/tests/helpers.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/tests/helpers.ts rename to src/plugins/embeddable/public/api/tests/helpers.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/tests/registry.test.ts b/src/plugins/embeddable/public/api/tests/registry.test.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/tests/registry.test.ts rename to src/plugins/embeddable/public/api/tests/registry.test.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/types.ts b/src/plugins/embeddable/public/api/types.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/api/types.ts rename to src/plugins/embeddable/public/api/types.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/bootstrap.ts b/src/plugins/embeddable/public/bootstrap.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/bootstrap.ts rename to src/plugins/embeddable/public/bootstrap.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/index.ts b/src/plugins/embeddable/public/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/index.ts rename to src/plugins/embeddable/public/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/apply_filter_action.test.ts b/src/plugins/embeddable/public/lib/actions/apply_filter_action.test.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/apply_filter_action.test.ts rename to src/plugins/embeddable/public/lib/actions/apply_filter_action.test.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/apply_filter_action.ts b/src/plugins/embeddable/public/lib/actions/apply_filter_action.ts similarity index 94% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/apply_filter_action.ts rename to src/plugins/embeddable/public/lib/actions/apply_filter_action.ts index 8ca5b25703a4e..0adb882a9006b 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/apply_filter_action.ts +++ b/src/plugins/embeddable/public/lib/actions/apply_filter_action.ts @@ -19,11 +19,7 @@ import { i18n } from '@kbn/i18n'; import { Filter } from '@kbn/es-query'; -import { - IAction, - createAction, - IncompatibleActionError, -} from '../../../../../../../../plugins/ui_actions/public'; +import { IAction, createAction, IncompatibleActionError } from 'src/plugins/ui_actions/public'; import { IEmbeddable, EmbeddableInput } from '../embeddables'; export const APPLY_FILTER_ACTION = 'APPLY_FILTER_ACTION'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/edit_panel_action.test.tsx b/src/plugins/embeddable/public/lib/actions/edit_panel_action.test.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/edit_panel_action.test.tsx rename to src/plugins/embeddable/public/lib/actions/edit_panel_action.test.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/edit_panel_action.ts b/src/plugins/embeddable/public/lib/actions/edit_panel_action.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/edit_panel_action.ts rename to src/plugins/embeddable/public/lib/actions/edit_panel_action.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/index.ts b/src/plugins/embeddable/public/lib/actions/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions/index.ts rename to src/plugins/embeddable/public/lib/actions/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/container.ts b/src/plugins/embeddable/public/lib/containers/container.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/container.ts rename to src/plugins/embeddable/public/lib/containers/container.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/embeddable_child_panel.test.tsx b/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx similarity index 97% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/embeddable_child_panel.test.tsx rename to src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx index 4b0803a890781..3c9e6e31220b2 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/embeddable_child_panel.test.tsx +++ b/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx @@ -31,7 +31,7 @@ import { ContactCardEmbeddable, } from '../test_samples/embeddables/contact_card/contact_card_embeddable'; // eslint-disable-next-line -import { inspectorPluginMock } from '../../../../../../../../plugins/inspector/public/mocks'; +import { inspectorPluginMock } from 'src/plugins/inspector/public/mocks'; import { mount } from 'enzyme'; test('EmbeddableChildPanel renders an embeddable when it is done loading', async () => { diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/embeddable_child_panel.tsx b/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx similarity index 97% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/embeddable_child_panel.tsx rename to src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx index f441d84cfce85..adc4f2eb7da0d 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/embeddable_child_panel.tsx +++ b/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx @@ -25,11 +25,11 @@ import { Subscription } from 'rxjs'; import { CoreStart } from 'src/core/public'; import { TGetActionsCompatibleWithTrigger } from 'src/plugins/ui_actions/public'; +import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import { ErrorEmbeddable, IEmbeddable } from '../embeddables'; import { EmbeddablePanel } from '../panel'; import { IContainer } from './i_container'; import { GetEmbeddableFactory, GetEmbeddableFactories } from '../types'; -import { Start as InspectorStartContract } from '../../../../../../../../plugins/inspector/public'; export interface EmbeddableChildPanelProps { embeddableId: string; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/i_container.ts b/src/plugins/embeddable/public/lib/containers/i_container.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/i_container.ts rename to src/plugins/embeddable/public/lib/containers/i_container.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/index.ts b/src/plugins/embeddable/public/lib/containers/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/containers/index.ts rename to src/plugins/embeddable/public/lib/containers/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/embeddable.test.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable.test.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/embeddable.test.tsx rename to src/plugins/embeddable/public/lib/embeddables/embeddable.test.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/embeddable.tsx rename to src/plugins/embeddable/public/lib/embeddables/embeddable.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/embeddable_factory.ts b/src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/embeddable_factory.ts rename to src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/error_embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/error_embeddable.tsx rename to src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/i_embeddable.ts b/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/i_embeddable.ts rename to src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/index.ts b/src/plugins/embeddable/public/lib/embeddables/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables/index.ts rename to src/plugins/embeddable/public/lib/embeddables/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/errors.test.ts b/src/plugins/embeddable/public/lib/errors.test.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/errors.test.ts rename to src/plugins/embeddable/public/lib/errors.test.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/errors.ts b/src/plugins/embeddable/public/lib/errors.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/errors.ts rename to src/plugins/embeddable/public/lib/errors.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/index.ts b/src/plugins/embeddable/public/lib/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/index.ts rename to src/plugins/embeddable/public/lib/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/_embeddable_panel.scss b/src/plugins/embeddable/public/lib/panel/_embeddable_panel.scss similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/_embeddable_panel.scss rename to src/plugins/embeddable/public/lib/panel/_embeddable_panel.scss diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/_index.scss b/src/plugins/embeddable/public/lib/panel/_index.scss similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/_index.scss rename to src/plugins/embeddable/public/lib/panel/_index.scss diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/embeddable_panel.test.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx similarity index 99% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/embeddable_panel.test.tsx rename to src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx index ed3e4b2ccff30..a00fd53d5c24b 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/embeddable_panel.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx @@ -41,7 +41,7 @@ import { ContactCardEmbeddableOutput, } from '../test_samples/embeddables/contact_card/contact_card_embeddable'; // eslint-disable-next-line -import { inspectorPluginMock } from '../../../../../../../../plugins/inspector/public/mocks'; +import { inspectorPluginMock } from 'src/plugins/inspector/public/mocks'; const actionRegistry = new Map(); const triggerRegistry = new Map(); diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/embeddable_panel.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx similarity index 97% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/embeddable_panel.tsx rename to src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx index 708d3e9695b07..2f11c59269f09 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/embeddable_panel.tsx +++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx @@ -24,9 +24,10 @@ import { buildContextMenuForActions, TGetActionsCompatibleWithTrigger, IAction, -} from '../../../../../../../../plugins/ui_actions/public'; -import { CoreStart } from '../../../../../../../../core/public'; +} from 'src/plugins/ui_actions/public'; +import { CoreStart } from 'src/core/public'; +import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import { CONTEXT_MENU_TRIGGER, PANEL_BADGE_TRIGGER } from '../triggers'; import { IEmbeddable } from '../embeddables/i_embeddable'; import { ViewMode, GetEmbeddableFactory, GetEmbeddableFactories } from '../types'; @@ -38,7 +39,6 @@ import { PanelHeader } from './panel_header/panel_header'; import { InspectPanelAction } from './panel_header/panel_actions/inspect_panel_action'; import { EditPanelAction } from '../actions'; import { CustomizePanelModal } from './panel_header/panel_actions/customize_title/customize_panel_modal'; -import { Start as InspectorStartContract } from '../../../../../../../../plugins/inspector/public'; interface Props { embeddable: IEmbeddable; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/index.ts b/src/plugins/embeddable/public/lib/panel/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/index.ts rename to src/plugins/embeddable/public/lib/panel/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/_index.scss b/src/plugins/embeddable/public/lib/panel/panel_header/_index.scss similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/_index.scss rename to src/plugins/embeddable/public/lib/panel/panel_header/_index.scss diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/_panel_options_menu_form.scss b/src/plugins/embeddable/public/lib/panel/panel_header/_panel_options_menu_form.scss similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/_panel_options_menu_form.scss rename to src/plugins/embeddable/public/lib/panel/panel_header/_panel_options_menu_form.scss diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/index.ts b/src/plugins/embeddable/public/lib/panel/panel_header/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/index.ts rename to src/plugins/embeddable/public/lib/panel/panel_header/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx similarity index 98% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx index 9799155f42d28..82a263932f2cb 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx @@ -29,7 +29,8 @@ import { import { FilterableEmbeddableFactory } from '../../../../test_samples/embeddables/filterable_embeddable_factory'; import { FilterableContainer } from '../../../../test_samples/embeddables/filterable_container'; import { GetEmbeddableFactory } from '../../../../types'; -import { coreMock } from '../../../../../../../../../../../core/public/mocks'; +// eslint-disable-next-line +import { coreMock } from 'src/core/public/mocks'; import { ContactCardEmbeddable } from '../../../../test_samples'; const embeddableFactories = new Map(); diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts similarity index 93% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts index e6db1a05ca238..3ca3a0864d9f1 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts @@ -18,10 +18,10 @@ */ import { i18n } from '@kbn/i18n'; import { IAction } from 'src/plugins/ui_actions/public'; +import { NotificationsStart } from 'src/core/public'; +import { KibanaReactOverlays } from 'src/plugins/kibana_react/public'; import { ViewMode, GetEmbeddableFactory, GetEmbeddableFactories } from '../../../../types'; import { openAddPanelFlyout } from './open_add_panel_flyout'; -import { NotificationsStart } from '../../../../../../../../../../../core/public'; -import { KibanaReactOverlays } from '../../../../../../../../../../../plugins/kibana_react/public'; import { IContainer } from '../../../../containers'; export const ADD_PANEL_ACTION_ID = 'ADD_PANEL_ACTION_ID'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx similarity index 98% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx index cfc26418fbdb6..036ca46bf6384 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx @@ -33,7 +33,7 @@ import { mount } from 'enzyme'; import { findTestSubject } from '@elastic/eui/lib/test'; // eslint-disable-next-line -import { coreMock } from '../../../../../../../../../../../core/public/mocks'; +import { coreMock } from 'src/core/public/mocks'; test('createNewEmbeddable() add embeddable to container', async () => { const core = coreMock.createStart(); diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/index.ts b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/index.ts rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx similarity index 90% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx index f439e34f6b283..bfa4f6e31d84e 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx @@ -17,11 +17,11 @@ * under the License. */ import React from 'react'; +import { NotificationsStart } from 'src/core/public'; +import { KibanaReactOverlays } from 'src/plugins/kibana_react/public'; import { IContainer } from '../../../../containers'; import { AddPanelFlyout } from './add_panel_flyout'; import { GetEmbeddableFactory, GetEmbeddableFactories } from '../../../../types'; -import { NotificationsStart } from '../../../../../../../../../../../core/public'; -import { KibanaReactOverlays } from '../../../../../../../../../../../plugins/kibana_react/public'; export async function openAddPanelFlyout(options: { embeddable: IContainer; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.ts b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.ts rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/index.ts b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/index.ts rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx similarity index 98% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx index 362b7e5fe5443..550f9706a634b 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx @@ -27,7 +27,7 @@ import { ContactCardEmbeddable, } from '../../../test_samples'; // eslint-disable-next-line -import { inspectorPluginMock } from '../../../../../../../../../../plugins/inspector/public/mocks'; +import { inspectorPluginMock } from 'src/plugins/inspector/public/mocks'; import { FilterStateStore } from '@kbn/es-query'; import { EmbeddableFactory, diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/inspect_panel_action.ts b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/inspect_panel_action.ts similarity index 92% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/inspect_panel_action.ts rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/inspect_panel_action.ts index f951ad01cbf78..8e4a43a01fc17 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/inspect_panel_action.ts +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/inspect_panel_action.ts @@ -18,8 +18,8 @@ */ import { i18n } from '@kbn/i18n'; -import { IAction } from '../../../../../../../../../../plugins/ui_actions/public'; -import { Start as InspectorStartContract } from '../../../../../../../../../../plugins/inspector/public'; +import { IAction } from 'src/plugins/ui_actions/public'; +import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import { IEmbeddable } from '../../../embeddables'; export const INSPECT_PANEL_ACTION_ID = 'openInspector'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/remove_panel_action.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/remove_panel_action.test.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/remove_panel_action.test.tsx rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/remove_panel_action.test.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts similarity index 95% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts index 36322e684d58c..98849f2b59d0e 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts @@ -17,10 +17,7 @@ * under the License. */ import { i18n } from '@kbn/i18n'; -import { - IAction, - IncompatibleActionError, -} from '../../../../../../../../../../plugins/ui_actions/public'; +import { IAction, IncompatibleActionError } from 'src/plugins/ui_actions/public'; import { ContainerInput, IContainer } from '../../../containers'; import { ViewMode } from '../../../types'; import { IEmbeddable } from '../../../embeddables'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_header.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx similarity index 88% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_header.tsx rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx index 8f4a9b1097044..fcdffdaa4e1eb 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_header.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx @@ -23,8 +23,6 @@ import React from 'react'; import { IAction } from 'src/plugins/ui_actions/public'; import { PanelOptionsMenu } from './panel_options_menu'; import { IEmbeddable } from '../../embeddables'; -import { VisualizeEmbeddable } from '../../../../../../../kibana/public/visualize/embeddable/visualize_embeddable'; -import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../../../kibana/public/visualize/embeddable/constants'; export interface PanelHeaderProps { title?: string; @@ -49,10 +47,8 @@ function renderBadges(badges: IAction[], embeddable: IEmbeddable) { )); } -function isVisualizeEmbeddable( - embeddable: IEmbeddable | VisualizeEmbeddable -): embeddable is VisualizeEmbeddable { - return embeddable.type === VISUALIZE_EMBEDDABLE_TYPE; +function isVisualizeEmbeddable(embeddable: IEmbeddable | any): embeddable is any { + return embeddable.type === 'VISUALIZE_EMBEDDABLE_TYPE'; } export function PanelHeader({ @@ -85,7 +81,7 @@ export function PanelHeader({ let viewDescr = ''; if (isVisualizeEmbeddable(embeddable)) { - const vd = (embeddable as VisualizeEmbeddable).getVisualizationDescription(); + const vd = (embeddable as any).getVisualizationDescription(); if (vd) { viewDescr = vd; } diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_options_menu.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_options_menu.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/panel/panel_header/panel_options_menu.tsx rename to src/plugins/embeddable/public/lib/panel/panel_header/panel_options_menu.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/edit_mode_action.ts b/src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts similarity index 93% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/edit_mode_action.ts rename to src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts index ab8cd71940a5e..a3bbca2715402 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/edit_mode_action.ts +++ b/src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts @@ -17,7 +17,7 @@ * under the License. */ -import { createAction } from '../../../../../../../../../plugins/ui_actions/public'; +import { createAction } from 'src/plugins/ui_actions/public'; import { ViewMode } from '../../types'; import { IEmbeddable } from '../../embeddables'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/get_message_modal.tsx b/src/plugins/embeddable/public/lib/test_samples/actions/get_message_modal.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/get_message_modal.tsx rename to src/plugins/embeddable/public/lib/test_samples/actions/get_message_modal.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/index.ts b/src/plugins/embeddable/public/lib/test_samples/actions/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/index.ts rename to src/plugins/embeddable/public/lib/test_samples/actions/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/say_hello_action.tsx b/src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx similarity index 96% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/say_hello_action.tsx rename to src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx index 69626dc31bab7..899de07ffce7c 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/say_hello_action.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx @@ -17,10 +17,7 @@ * under the License. */ -import { - IAction, - IncompatibleActionError, -} from '../../../../../../../../../plugins/ui_actions/public'; +import { IAction, IncompatibleActionError } from 'src/plugins/ui_actions/public'; import { EmbeddableInput, Embeddable, EmbeddableOutput, IEmbeddable } from '../../embeddables'; export const SAY_HELLO_ACTION = 'SAY_HELLO_ACTION'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/send_message_action.tsx b/src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx similarity index 92% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/send_message_action.tsx rename to src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx index 23f4029b9fcde..b5396830a6c0d 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/actions/send_message_action.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx @@ -18,14 +18,11 @@ */ import React from 'react'; import { EuiFlyoutBody } from '@elastic/eui'; -import { - createAction, - IncompatibleActionError, -} from '../../../../../../../../../plugins/ui_actions/public'; +import { createAction, IncompatibleActionError } from 'src/plugins/ui_actions/public'; +import { CoreStart } from 'src/core/public'; import { Embeddable, EmbeddableInput } from '../../embeddables'; import { GetMessageModal } from './get_message_modal'; import { FullNameEmbeddableOutput, hasFullNameOutput } from './say_hello_action'; -import { CoreStart } from '../../../../../../../../../core/public'; export const SEND_MESSAGE_ACTION = 'SEND_MESSAGE_ACTION'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card.tsx rename to src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable.tsx rename to src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx similarity index 97% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx rename to src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx index a4e3218560bdc..962cddfa3735f 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx @@ -21,12 +21,12 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { TExecuteTriggerActions } from 'src/plugins/ui_actions/public'; +import { CoreStart } from 'src/core/public'; import { EmbeddableFactory } from '../../../embeddables'; import { Container } from '../../../containers'; import { ContactCardEmbeddable, ContactCardEmbeddableInput } from './contact_card_embeddable'; import { ContactCardInitializer } from './contact_card_initializer'; import { EmbeddableFactoryOptions } from '../../../embeddables/embeddable_factory'; -import { CoreStart } from '../../../../../../../../../../core/public'; export const CONTACT_CARD_EMBEDDABLE = 'CONTACT_CARD_EMBEDDABLE'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx rename to src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/index.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/index.ts rename to src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory.ts rename to src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/empty_embeddable.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/empty_embeddable.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/empty_embeddable.tsx rename to src/plugins/embeddable/public/lib/test_samples/embeddables/empty_embeddable.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/filterable_container.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/filterable_container.tsx rename to src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/filterable_container_factory.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container_factory.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/filterable_container_factory.ts rename to src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container_factory.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/filterable_embeddable.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_embeddable.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/filterable_embeddable.tsx rename to src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_embeddable.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/filterable_embeddable_factory.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_embeddable_factory.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/filterable_embeddable_factory.ts rename to src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_embeddable_factory.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable.tsx rename to src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable_factory.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable_factory.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable_factory.ts rename to src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable_factory.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world/index.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world/index.ts rename to src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world_container.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx similarity index 96% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world_container.tsx rename to src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx index 2a7406f49ad7e..8209f5bca2411 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world_container.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx @@ -21,10 +21,10 @@ import ReactDOM from 'react-dom'; import { I18nProvider } from '@kbn/i18n/react'; import { CoreStart } from 'src/core/public'; import { TGetActionsCompatibleWithTrigger } from 'src/plugins/ui_actions/public'; +import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import { Container, ViewMode, ContainerInput } from '../..'; import { HelloWorldContainerComponent } from './hello_world_container_component'; import { GetEmbeddableFactory, GetEmbeddableFactories } from '../../types'; -import { Start as InspectorStartContract } from '../../../../../../../../../plugins/inspector/public'; export const HELLO_WORLD_CONTAINER = 'HELLO_WORLD_CONTAINER'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world_container_component.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container_component.tsx similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world_container_component.tsx rename to src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container_component.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/index.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/index.ts rename to src/plugins/embeddable/public/lib/test_samples/embeddables/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/index.ts b/src/plugins/embeddable/public/lib/test_samples/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/index.ts rename to src/plugins/embeddable/public/lib/test_samples/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/triggers/index.ts b/src/plugins/embeddable/public/lib/triggers/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/triggers/index.ts rename to src/plugins/embeddable/public/lib/triggers/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/types.ts b/src/plugins/embeddable/public/lib/types.ts similarity index 95% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/types.ts rename to src/plugins/embeddable/public/lib/types.ts index 5088bddaa78d7..1518c6ae8b26e 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/types.ts +++ b/src/plugins/embeddable/public/lib/types.ts @@ -17,8 +17,8 @@ * under the License. */ +import { Adapters } from 'src/plugins/inspector/public'; import { EmbeddableFactory } from './embeddables/embeddable_factory'; -import { Adapters } from '../../../../../../../plugins/inspector/public'; export interface Trigger { id: string; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.ts b/src/plugins/embeddable/public/mocks.ts similarity index 92% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.ts rename to src/plugins/embeddable/public/mocks.ts index c24f310665ae1..ef1517bb7f1d5 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.ts +++ b/src/plugins/embeddable/public/mocks.ts @@ -18,10 +18,10 @@ */ import { Plugin } from '.'; -import { coreMock } from '../../../../../../core/public/mocks'; +import { coreMock } from '../../../core/public/mocks'; // eslint-disable-next-line -import { uiActionsPluginMock } from '../../../../../../plugins/ui_actions/public/mocks'; +import { uiActionsPluginMock } from '../../ui_actions/public/mocks'; export type Setup = jest.Mocked>; export type Start = jest.Mocked>; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/plugin.ts b/src/plugins/embeddable/public/plugin.ts similarity index 94% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/plugin.ts rename to src/plugins/embeddable/public/plugin.ts index 0e4a34da40c75..458c8bfeb8762 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/plugin.ts +++ b/src/plugins/embeddable/public/plugin.ts @@ -18,12 +18,7 @@ */ import { IUiActionsSetup } from 'src/plugins/ui_actions/public'; -import { - PluginInitializerContext, - CoreSetup, - CoreStart, - Plugin, -} from '../../../../../../core/public'; +import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../core/public'; import { EmbeddableFactoryRegistry } from './types'; import { createApi, EmbeddableApi } from './api'; import { bootstrap } from './bootstrap'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/apply_filter_action.test.ts b/src/plugins/embeddable/public/tests/apply_filter_action.test.ts similarity index 98% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/apply_filter_action.test.ts rename to src/plugins/embeddable/public/tests/apply_filter_action.test.ts index 3273b335b5074..52500acc3dc59 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/apply_filter_action.test.ts +++ b/src/plugins/embeddable/public/tests/apply_filter_action.test.ts @@ -31,7 +31,7 @@ import { FilterableEmbeddableInput, } from '../lib/test_samples'; // eslint-disable-next-line -import { inspectorPluginMock } from '../../../../../../../plugins/inspector/public/mocks'; +import { inspectorPluginMock } from 'src/plugins/inspector/public/mocks'; import { FilterStateStore } from '@kbn/es-query'; test('ApplyFilterAction applies the filter to the root of the container tree', async () => { diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/container.test.ts b/src/plugins/embeddable/public/tests/container.test.ts similarity index 99% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/container.test.ts rename to src/plugins/embeddable/public/tests/container.test.ts index 8cfd627e34f87..e2b31176e07d3 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/container.test.ts +++ b/src/plugins/embeddable/public/tests/container.test.ts @@ -43,7 +43,8 @@ import { FilterableContainer, FilterableContainerInput, } from '../lib/test_samples/embeddables/filterable_container'; -import { coreMock } from '../../../../../../../core/public/mocks'; +// eslint-disable-next-line +import { coreMock } from 'src/core/public/mocks'; import { testPlugin } from './test_plugin'; import { of } from './helpers'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/customize_panel_modal.test.tsx b/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx similarity index 98% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/customize_panel_modal.test.tsx rename to src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx index c3375d9de13bc..b5b6e54c304b7 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/customize_panel_modal.test.tsx +++ b/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx @@ -31,7 +31,8 @@ import { ContactCardEmbeddableFactory, } from '../lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; import { HelloWorldContainer } from '../lib/test_samples/embeddables/hello_world_container'; -import { coreMock } from '../../../../../../../core/public/mocks'; +// eslint-disable-next-line +import { coreMock } from 'src/core/public/mocks'; import { testPlugin } from './test_plugin'; import { EmbeddableApi } from '../api'; import { CustomizePanelModal } from '../lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/explicit_input.test.ts b/src/plugins/embeddable/public/tests/explicit_input.test.ts similarity index 98% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/explicit_input.test.ts rename to src/plugins/embeddable/public/tests/explicit_input.test.ts index 08009c165cbce..0a7f5e173f8b9 100644 --- a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/explicit_input.test.ts +++ b/src/plugins/embeddable/public/tests/explicit_input.test.ts @@ -33,7 +33,7 @@ import { FilterableContainer } from '../lib/test_samples/embeddables/filterable_ import { isErrorEmbeddable } from '../lib'; import { HelloWorldContainer } from '../lib/test_samples/embeddables/hello_world_container'; // eslint-disable-next-line -import { coreMock } from '../../../../../../../core/public/mocks'; +import { coreMock } from 'src/core/public/mocks'; const { setup, doStart, coreStart, uiActions } = testPlugin( coreMock.createSetup(), diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/get_embeddable_factories.test.ts b/src/plugins/embeddable/public/tests/get_embeddable_factories.test.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/get_embeddable_factories.test.ts rename to src/plugins/embeddable/public/tests/get_embeddable_factories.test.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/helpers.ts b/src/plugins/embeddable/public/tests/helpers.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/helpers.ts rename to src/plugins/embeddable/public/tests/helpers.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/test_plugin.ts b/src/plugins/embeddable/public/tests/test_plugin.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/tests/test_plugin.ts rename to src/plugins/embeddable/public/tests/test_plugin.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/types.ts b/src/plugins/embeddable/public/types.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/types.ts rename to src/plugins/embeddable/public/types.ts From 8ff963d940ffd21aa3d11e7f8be16d449151d1ac Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 13:55:39 +0200 Subject: [PATCH 02/14] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20TypeScript=20?= =?UTF-8?q?type=20check=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/np_ready/public/legacy.ts | 8 ++------ .../lib/actions/expand_panel_action.test.tsx | 5 ++--- .../lib/actions/expand_panel_action.tsx | 2 +- .../embeddable/dashboard_container.test.tsx | 6 ++++-- .../lib/embeddable/dashboard_container.tsx | 4 ++-- .../embeddable/grid/dashboard_grid.test.tsx | 3 ++- .../panel/create_panel_state.test.ts | 3 ++- .../viewport/dashboard_viewport.test.tsx | 3 ++- .../np_ready/public/lib/embeddable_api.ts | 2 +- .../public/tests/dashboard_container.test.tsx | 12 ++++++------ .../kibana/public/dashboard/dashboard_app.tsx | 2 +- .../dashboard/dashboard_app_controller.tsx | 19 +++++++++---------- .../public/dashboard/dashboard_state.test.ts | 2 +- .../dashboard/dashboard_state_manager.ts | 2 +- .../public/dashboard/dashboard_strings.ts | 2 +- ...embeddable_saved_object_converters.test.ts | 2 +- .../dashboard/lib/get_app_state_defaults.ts | 2 +- .../dashboard/top_nav/get_top_nav_config.ts | 2 +- .../kibana/public/dashboard/types.ts | 2 +- .../discover/embeddable/search_embeddable.ts | 6 +----- .../embeddable/search_embeddable_factory.ts | 11 +++-------- .../public/discover/embeddable/types.ts | 6 +----- .../embeddable/disabled_lab_embeddable.tsx | 2 +- .../embeddable/visualize_embeddable.ts | 2 +- .../visualize_embeddable_factory.tsx | 9 ++++++--- .../public/new_platform/__mocks__/helpers.ts | 3 +++ .../ui/public/new_platform/new_platform.ts | 3 +++ .../hello_world_container_component.tsx | 2 +- .../public/np_ready/public/app/app.tsx | 5 +---- .../app/dashboard_container_example.tsx | 13 ++++++------- .../np_ready/public/app/dashboard_input.ts | 4 +--- .../app/hello_world_container_example.tsx | 14 ++++++++------ .../app/hello_world_embeddable_example.tsx | 6 +++--- .../public/np_ready/public/embeddable_api.ts | 3 ++- .../hello_world_embeddable_factory.ts | 8 +++++--- .../public/np_ready/public/legacy.ts | 8 ++------ .../public/np_ready/public/plugin.tsx | 2 +- .../public/sample_panel_action.tsx | 5 +---- .../public/sample_panel_link.ts | 2 +- .../public/can_inherit_time_range.test.ts | 4 +++- .../np_ready/public/can_inherit_time_range.ts | 6 +----- .../public/custom_time_range_action.test.ts | 6 ++++-- .../public/custom_time_range_action.tsx | 7 +------ .../public/custom_time_range_badge.test.ts | 2 +- .../public/custom_time_range_badge.tsx | 6 +----- .../public/customize_time_range_modal.tsx | 6 +----- .../public/does_inherit_time_range.ts | 6 +----- .../public/np_ready/public/legacy.ts | 10 +++------- .../public/np_ready/public/plugin.ts | 5 +++-- .../test_helpers/time_range_container.ts | 4 ++-- .../test_helpers/time_range_embeddable.ts | 4 ++-- .../time_range_embeddable_factory.ts | 6 +----- .../expression_types/embeddable.ts | 2 +- .../functions/common/saved_map.ts | 2 +- .../renderers/embeddable.tsx | 9 ++++----- .../components/embeddable_flyout/flyout.tsx | 6 +++--- .../embeddable/embeddable.tsx | 2 +- .../embeddable/embeddable_factory.ts | 2 +- .../public/editor_frame_plugin/plugin.tsx | 9 ++++----- .../panel_actions/get_csv_panel_action.tsx | 6 +----- .../actions/apply_siem_filter_action.test.tsx | 6 +----- .../actions/apply_siem_filter_action.tsx | 2 +- .../components/embeddables/embedded_map.tsx | 7 +++---- .../embeddables/embedded_map_helpers.tsx | 11 +++++------ .../public/components/embeddables/types.ts | 6 +----- 65 files changed, 143 insertions(+), 196 deletions(-) diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/legacy.ts b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/legacy.ts index ccb04d8c2e027..c0f44ad3adf08 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/legacy.ts +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/legacy.ts @@ -24,20 +24,16 @@ import { ExitFullScreenButton } from 'ui/exit_full_screen'; /* eslint-enable @kbn/eslint/no-restricted-paths */ import { plugin } from '.'; -import { - setup as embeddableSetup, - start as embeddableStart, -} from '../../../../embeddable_api/public/np_ready/public/legacy'; const pluginInstance = plugin({} as any); export const setup = pluginInstance.setup(npSetup.core, { - embeddable: embeddableSetup, + embeddable: npSetup.plugins.embeddable, uiActions: npSetup.plugins.uiActions, }); export const start = pluginInstance.start(npStart.core, { - embeddable: embeddableStart, + embeddable: npStart.plugins.embeddable, inspector: npStart.plugins.inspector, __LEGACY: { SavedObjectFinder, diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx index 611b37dd7d54e..8a351494b6604 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx @@ -24,12 +24,11 @@ import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helper import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, -} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; -import { ContactCardEmbeddable, ContactCardEmbeddableInput, ContactCardEmbeddableOutput, -} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; + // eslint-disable-next-line @kbn/eslint/no-restricted-paths +} from 'src/plugins/embeddable/public/lib/test_samples'; import { DashboardOptions } from '../embeddable/dashboard_container_factory'; const embeddableFactories = new Map(); diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.tsx index f05d0b0efc2ee..1e7d20bb63b18 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.tsx @@ -18,7 +18,7 @@ */ import { i18n } from '@kbn/i18n'; -import { IEmbeddable } from '../../../../../../embeddable_api/public/np_ready/public'; +import { IEmbeddable } from '../embeddable_api'; import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable'; import { IAction, diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx index 8529f8944cbab..2fdf171b521be 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx @@ -26,12 +26,14 @@ import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helper import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, -} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; + // eslint-disable-next-line +} from 'src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; import { ContactCardEmbeddableInput, ContactCardEmbeddable, ContactCardEmbeddableOutput, -} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; + // eslint-disable-next-line +} from 'src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; const options: DashboardContainerOptions = { application: {} as any, diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.tsx index 919995f544960..8be5f7c42daf4 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.tsx @@ -30,7 +30,8 @@ import { ViewMode, EmbeddableFactory, IEmbeddable, -} from '../../../../../../embeddable_api/public/np_ready/public'; + Start as EmbeddableStartContract, +} from '../embeddable_api'; import { DASHBOARD_CONTAINER_TYPE } from './dashboard_container_factory'; import { createPanelState } from './panel'; import { DashboardPanelState } from './types'; @@ -38,7 +39,6 @@ import { DashboardViewport } from './viewport/dashboard_viewport'; import { Query } from '../../../../../../data/public'; import { CoreStart } from '../../../../../../../../core/public'; import { Start as InspectorStartContract } from '../../../../../../../../plugins/inspector/public'; -import { Start as EmbeddableStartContract } from '../../../../../../embeddable_api/public/np_ready/public'; import { KibanaReactContext, KibanaReactContextValue, diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/grid/dashboard_grid.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/grid/dashboard_grid.test.tsx index 641d55aea6c58..8dff4d7a7c826 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/grid/dashboard_grid.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/grid/dashboard_grid.test.tsx @@ -30,7 +30,8 @@ import { getSampleDashboardInput } from '../../test_helpers'; import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, -} from '../../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; + // eslint-disable-next-line @kbn/eslint/no-restricted-paths +} from 'src/plugins/embeddable/public/lib/test_samples'; import { KibanaContextProvider } from '../../../../../../../../../plugins/kibana_react/public'; let dashboardContainer: DashboardContainer | undefined; diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/panel/create_panel_state.test.ts b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/panel/create_panel_state.test.ts index 45eb4056a4ffc..3ca791f23a087 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/panel/create_panel_state.test.ts +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/panel/create_panel_state.test.ts @@ -21,7 +21,8 @@ import { DEFAULT_PANEL_HEIGHT, DEFAULT_PANEL_WIDTH } from '../dashboard_constant import { DashboardPanelState } from '../types'; import { createPanelState } from './create_panel_state'; import { EmbeddableInput } from '../../embeddable_api'; -import { CONTACT_CARD_EMBEDDABLE } from '../../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { CONTACT_CARD_EMBEDDABLE } from 'src/plugins/embeddable/public/lib/test_samples'; interface TestInput extends EmbeddableInput { test: string; diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/viewport/dashboard_viewport.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/viewport/dashboard_viewport.test.tsx index 2a28e187fad64..6da7dcb90cbc7 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/viewport/dashboard_viewport.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/viewport/dashboard_viewport.test.tsx @@ -31,7 +31,8 @@ import { getSampleDashboardInput } from '../../test_helpers'; import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, -} from '../../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; + // eslint-disable-next-line +} from 'src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; import { KibanaContextProvider } from '../../../../../../../../../plugins/kibana_react/public'; let dashboardContainer: DashboardContainer | undefined; diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts index 17911b908d3b3..2ad99f830aa62 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts @@ -17,4 +17,4 @@ * under the License. */ -export * from '../../../../../embeddable_api/public/np_ready/public'; +export * from 'src/plugins/embeddable/public'; diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx index e9b84eca594ae..f091ed973a9c2 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx @@ -31,15 +31,15 @@ import { import { getSampleDashboardInput } from '../lib/test_helpers'; import { CONTACT_CARD_EMBEDDABLE, - ContactCardEmbeddableFactory, -} from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; -import { ContactCardEmbeddableInput, ContactCardEmbeddable, ContactCardEmbeddableOutput, -} from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; -import { embeddablePluginMock } from '../../../../../embeddable_api/public/np_ready/public/mocks'; -import { createEditModeAction } from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples/actions/edit_mode_action'; + createEditModeAction, + ContactCardEmbeddableFactory, + // eslint-disable-next-line @kbn/eslint/no-restricted-paths +} from 'src/plugins/embeddable/public/lib/test_samples'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; // eslint-disable-next-line import { inspectorPluginMock } from '../../../../../../../plugins/inspector/public/mocks'; import { KibanaContextProvider } from '../../../../../../../plugins/kibana_react/public'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx index 1f65ccebb67d9..b2bcd62e11b5a 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx @@ -43,7 +43,7 @@ import { StaticIndexPattern, Query, SavedQuery } from 'plugins/data'; import moment from 'moment'; import { Subscription } from 'rxjs'; -import { ViewMode } from '../../../embeddable_api/public/np_ready/public'; +import { ViewMode } from 'src/plugins/embeddable/public'; import { SavedObjectDashboard } from './saved_dashboard/saved_dashboard'; import { DashboardAppState, SavedDashboardPanel, ConfirmModalFn } from './types'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx index 741931af11c7d..14d3ad8e90424 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx @@ -57,6 +57,12 @@ import { capabilities } from 'ui/capabilities'; import { Subscription } from 'rxjs'; import { npStart } from 'ui/new_platform'; import { SavedObjectFinder } from 'ui/saved_objects/components/saved_object_finder'; +import { + isErrorEmbeddable, + ErrorEmbeddable, + ViewMode, + openAddPanelFlyout, +} from 'src/plugins/embeddable/public'; import { data } from '../../../data/public/setup'; import { @@ -66,13 +72,6 @@ import { DashboardContainerInput, DashboardPanelState, } from '../../../dashboard_embeddable_container/public/np_ready/public'; -import { - isErrorEmbeddable, - ErrorEmbeddable, - ViewMode, - openAddPanelFlyout, -} from '../../../embeddable_api/public/np_ready/public'; -import { start } from '../../../embeddable_api/public/np_ready/public/legacy'; import { DashboardAppState, NavAction, ConfirmModalFn, SavedDashboardPanel } from './types'; import { showOptionsPopover } from './top_nav/show_options_popover'; @@ -242,7 +241,7 @@ export class DashboardAppController { let outputSubscription: Subscription | undefined; const dashboardDom = document.getElementById('dashboardViewport'); - const dashboardFactory = start.getEmbeddableFactory( + const dashboardFactory = npStart.plugins.embeddable.getEmbeddableFactory( DASHBOARD_CONTAINER_TYPE ) as DashboardContainerFactory; dashboardFactory @@ -745,8 +744,8 @@ export class DashboardAppController { if (dashboardContainer && !isErrorEmbeddable(dashboardContainer)) { openAddPanelFlyout({ embeddable: dashboardContainer, - getAllFactories: start.getEmbeddableFactories, - getFactory: start.getEmbeddableFactory, + getAllFactories: npStart.plugins.embeddable.getEmbeddableFactories, + getFactory: npStart.plugins.embeddable.getEmbeddableFactory, notifications: npStart.core.notifications, overlays: npStart.core.overlays, SavedObjectFinder, diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state.test.ts b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state.test.ts index d7847c8338cd2..a25ce1e607f9a 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state.test.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state.test.ts @@ -24,7 +24,7 @@ import { getAppStateMock, getSavedDashboardMock } from './__tests__'; import { AppStateClass } from 'ui/state_management/app_state'; import { DashboardAppState } from './types'; import { TimeRange } from 'src/plugins/data/public'; -import { ViewMode } from '../../../embeddable_api/public/np_ready/public'; +import { ViewMode } from 'src/plugins/embeddable/public'; import { InputTimeRange } from 'ui/timefilter'; jest.mock('ui/registry/field_formats', () => ({ diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts index 358c434b327e1..b7f30b7adc35e 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts @@ -28,7 +28,7 @@ import { migrateLegacyQuery } from 'ui/utils/migrate_legacy_query'; import { Moment } from 'moment'; import { DashboardContainer } from 'src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public'; -import { ViewMode } from '../../../embeddable_api/public/np_ready/public'; +import { ViewMode } from 'src/plugins/embeddable/public'; import { Query } from '../../../data/public'; import { getAppStateDefaults, migrateAppState } from './lib'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts index 40393fb08cb10..80d727c7f9ade 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts @@ -18,7 +18,7 @@ */ import { i18n } from '@kbn/i18n'; -import { ViewMode } from '../../../embeddable_api/public/np_ready/public'; +import { ViewMode } from 'src/plugins/embeddable/public'; /** * @param title {string} the current title of the dashboard diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.test.ts b/src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.test.ts index 99bb6b115b985..f6a7428959587 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.test.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.test.ts @@ -24,7 +24,7 @@ import { } from './embeddable_saved_object_converters'; import { SavedDashboardPanel } from '../types'; import { DashboardPanelState } from 'src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public'; -import { EmbeddableInput } from 'src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { EmbeddableInput } from 'src/plugins/embeddable/public'; interface CustomInput extends EmbeddableInput { something: string; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts b/src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts index 8fc26a3f53d06..b96e4bb04703a 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ViewMode } from '../../../../embeddable_api/public/np_ready/public'; +import { ViewMode } from 'src/plugins/embeddable/public'; import { SavedObjectDashboard } from '../saved_dashboard/saved_dashboard'; import { DashboardAppStateDefaults } from '../types'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/top_nav/get_top_nav_config.ts b/src/legacy/core_plugins/kibana/public/dashboard/top_nav/get_top_nav_config.ts index 05b7fcce07afa..5996980c55e8c 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/top_nav/get_top_nav_config.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/top_nav/get_top_nav_config.ts @@ -18,7 +18,7 @@ */ import { i18n } from '@kbn/i18n'; -import { ViewMode } from '../../../../embeddable_api/public/np_ready/public'; +import { ViewMode } from 'src/plugins/embeddable/public'; import { TopNavIds } from './top_nav_ids'; import { NavAction } from '../types'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/types.ts b/src/legacy/core_plugins/kibana/public/dashboard/types.ts index ef7192bf30025..ccccc89004e36 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/types.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/types.ts @@ -21,7 +21,7 @@ import { AppState } from 'ui/state_management/app_state'; import { Filter } from '@kbn/es-query'; import { Query } from 'src/legacy/core_plugins/data/public'; import { AppState as TAppState } from 'ui/state_management/app_state'; -import { ViewMode } from 'src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { ViewMode } from 'src/plugins/embeddable/public'; import { RawSavedDashboardPanelTo60, RawSavedDashboardPanel610, diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts index d5bf868f3bf72..5d5427bc671db 100644 --- a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts +++ b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts @@ -37,13 +37,9 @@ import { i18n } from '@kbn/i18n'; import { toastNotifications } from 'ui/notify'; import { TimeRange } from 'src/plugins/data/public'; import { TExecuteTriggerActions } from 'src/plugins/ui_actions/public'; +import { APPLY_FILTER_TRIGGER, Embeddable, Container } from 'src/plugins/embeddable/public'; import { setup as data } from '../../../../data/public/legacy'; import { Query, onlyDisabledFiltersChanged, getTime } from '../../../../data/public'; -import { - APPLY_FILTER_TRIGGER, - Embeddable, - Container, -} from '../../../../embeddable_api/public/np_ready/public'; import * as columnActions from '../doc_table/actions/columns'; import { SavedSearch } from '../types'; import searchTemplate from './search_template.html'; diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts index ca106711e3c07..04e2bef4d48ea 100644 --- a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts +++ b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts @@ -19,19 +19,14 @@ import '../doc_table'; import { capabilities } from 'ui/capabilities'; -import { npStart } from 'ui/new_platform'; +import { npStart, npSetup } from 'ui/new_platform'; import { i18n } from '@kbn/i18n'; import chrome from 'ui/chrome'; import { IPrivate } from 'ui/private'; import { TimeRange } from 'src/plugins/data/public'; import { FilterBarQueryFilterProvider } from 'ui/filter_manager/query_filter'; import { TExecuteTriggerActions } from 'src/plugins/ui_actions/public'; -import { - EmbeddableFactory, - ErrorEmbeddable, - Container, -} from '../../../../embeddable_api/public/np_ready/public'; -import { setup } from '../../../../embeddable_api/public/np_ready/public/legacy'; +import { EmbeddableFactory, ErrorEmbeddable, Container } from 'src/plugins/embeddable/public'; import { SavedSearchLoader } from '../types'; import { SearchEmbeddable, SEARCH_EMBEDDABLE_TYPE } from './search_embeddable'; import { SearchInput, SearchOutput } from './types'; @@ -112,4 +107,4 @@ export class SearchEmbeddableFactory extends EmbeddableFactory< } const factory = new SearchEmbeddableFactory(npStart.plugins.uiActions.executeTriggerActions); -setup.registerEmbeddableFactory(factory.type, factory); +npSetup.plugins.embeddable.registerEmbeddableFactory(factory.type, factory); diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/types.ts b/src/legacy/core_plugins/kibana/public/discover/embeddable/types.ts index a0e15e99b742d..bc46cdbe82981 100644 --- a/src/legacy/core_plugins/kibana/public/discover/embeddable/types.ts +++ b/src/legacy/core_plugins/kibana/public/discover/embeddable/types.ts @@ -21,12 +21,8 @@ import { StaticIndexPattern } from 'ui/index_patterns'; import { TimeRange } from 'src/plugins/data/public'; import { Query } from 'src/legacy/core_plugins/data/public'; import { Filter } from '@kbn/es-query'; +import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from 'src/plugins/embeddable/public'; import { SavedSearch } from '../types'; -import { - EmbeddableInput, - EmbeddableOutput, - IEmbeddable, -} from '../../../../embeddable_api/public/np_ready/public'; import { SortOrder } from '../doc_table/components/table_header/helpers'; export interface SearchInput extends EmbeddableInput { diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx b/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx index 63c4661f4acf2..902fa1da04e1a 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx @@ -19,7 +19,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { Embeddable, EmbeddableOutput } from '../../../../embeddable_api/public/np_ready/public'; +import { Embeddable, EmbeddableOutput } from 'src/plugins/embeddable/public'; import { DisabledLabVisualization } from './disabled_lab_visualization'; import { VisualizeInput } from './visualize_embeddable'; import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts b/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts index 147cbed6b1ea1..ce5ea7fcb4335 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts @@ -36,7 +36,7 @@ import { EmbeddableOutput, Embeddable, Container, -} from '../../../../embeddable_api/public/np_ready/public'; +} from 'src/plugins/embeddable/public'; import { Query, onlyDisabledFiltersChanged } from '../../../../data/public'; import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; 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 d8ebef9a60413..3b5c28b2caabb 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,8 +52,8 @@ import { ErrorEmbeddable, Container, EmbeddableOutput, -} from '../../../../embeddable_api/public/np_ready/public'; -import { setup } from '../../../../embeddable_api/public/np_ready/public/legacy'; +} from 'src/plugins/embeddable/public'; +import { npSetup } from 'ui/new_platform'; import { showNewVisModal } from '../wizard'; import { SavedVisualizations } from '../types'; import { DisabledLabEmbeddable } from './disabled_lab_embeddable'; @@ -184,5 +184,8 @@ export class VisualizeEmbeddableFactory extends EmbeddableFactory< } VisualizeEmbeddableFactory.createVisualizeEmbeddableFactory().then(embeddableFactory => { - setup.registerEmbeddableFactory(VISUALIZE_EMBEDDABLE_TYPE, embeddableFactory); + npSetup.plugins.embeddable.registerEmbeddableFactory( + VISUALIZE_EMBEDDABLE_TYPE, + embeddableFactory + ); }); diff --git a/src/legacy/ui/public/new_platform/__mocks__/helpers.ts b/src/legacy/ui/public/new_platform/__mocks__/helpers.ts index 2705d71b026f8..5c7f7be060374 100644 --- a/src/legacy/ui/public/new_platform/__mocks__/helpers.ts +++ b/src/legacy/ui/public/new_platform/__mocks__/helpers.ts @@ -20,6 +20,7 @@ /* eslint-disable @kbn/eslint/no-restricted-paths */ import { coreMock } from '../../../../../core/public/mocks'; import { dataPluginMock } from '../../../../../plugins/data/public/mocks'; +import { embeddablePluginMock } from '../../../../../plugins/embeddable/public/mocks'; import { expressionsPluginMock } from '../../../../../plugins/expressions/public/mocks'; import { inspectorPluginMock } from '../../../../../plugins/inspector/public/mocks'; import { uiActionsPluginMock } from '../../../../../plugins/ui_actions/public/mocks'; @@ -28,12 +29,14 @@ import { uiActionsPluginMock } from '../../../../../plugins/ui_actions/public/mo export const pluginsMock = { createSetup: () => ({ data: dataPluginMock.createSetupContract(), + embeddable: embeddablePluginMock.createSetupContract(), inspector: inspectorPluginMock.createSetupContract(), expressions: expressionsPluginMock.createSetupContract(), uiActions: uiActionsPluginMock.createSetupContract(), }), createStart: () => ({ data: dataPluginMock.createStartContract(), + embeddable: embeddablePluginMock.createStartContract(), inspector: inspectorPluginMock.createStartContract(), expressions: expressionsPluginMock.createStartContract(), uiActions: uiActionsPluginMock.createStartContract(), diff --git a/src/legacy/ui/public/new_platform/new_platform.ts b/src/legacy/ui/public/new_platform/new_platform.ts index 2b46b0e304ba3..ed13af591525c 100644 --- a/src/legacy/ui/public/new_platform/new_platform.ts +++ b/src/legacy/ui/public/new_platform/new_platform.ts @@ -17,6 +17,7 @@ * under the License. */ import { IUiActionsStart, IUiActionsSetup } from 'src/plugins/ui_actions/public'; +import { Start as EmbeddableStart, Setup as EmbeddableSetup } from 'src/plugins/embeddable/public'; import { LegacyCoreSetup, LegacyCoreStart } from '../../../../core/public'; import { Plugin as DataPlugin } from '../../../../plugins/data/public'; import { Plugin as ExpressionsPlugin } from '../../../../plugins/expressions/public'; @@ -28,6 +29,7 @@ import { EuiUtilsStart } from '../../../../plugins/eui_utils/public'; export interface PluginsSetup { data: ReturnType; + embeddable: EmbeddableSetup; expressions: ReturnType; inspector: InspectorSetup; uiActions: IUiActionsSetup; @@ -35,6 +37,7 @@ export interface PluginsSetup { export interface PluginsStart { data: ReturnType; + embeddable: EmbeddableStart; eui_utils: EuiUtilsStart; expressions: ReturnType; inspector: InspectorStart; diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container_component.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container_component.tsx index 9f09d7058744f..7c0e09eff1d50 100644 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container_component.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container_component.tsx @@ -22,9 +22,9 @@ import { Subscription } from 'rxjs'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { CoreStart } from 'src/core/public'; import { TGetActionsCompatibleWithTrigger } from 'src/plugins/ui_actions/public'; +import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import { IContainer, PanelState, EmbeddableChildPanel } from '../..'; import { GetEmbeddableFactory, GetEmbeddableFactories } from '../../types'; -import { Start as InspectorStartContract } from '../../../../../../../../../plugins/inspector/public'; interface Props { container: IContainer; diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx index c0ed2b027f0e4..63662293d3910 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx @@ -19,10 +19,7 @@ import { EuiTab } from '@elastic/eui'; import React, { Component } from 'react'; import { CoreStart } from 'src/core/public'; -import { - GetEmbeddableFactory, - GetEmbeddableFactories, -} from 'src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { GetEmbeddableFactory, GetEmbeddableFactories } from 'src/plugins/embeddable/public'; import { TGetActionsCompatibleWithTrigger } from '../../../../../../../../src/plugins/ui_actions/public'; import { ContactCardEmbeddableExample } from './hello_world_embeddable_example'; import { HelloWorldContainerExample } from './hello_world_container_example'; diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_container_example.tsx b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_container_example.tsx index 528b98c70a6da..ba9a874bcc5d3 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_container_example.tsx +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_container_example.tsx @@ -18,12 +18,6 @@ */ import React from 'react'; import { EuiButton, EuiLoadingChart } from '@elastic/eui'; -import { - DASHBOARD_CONTAINER_TYPE, - DashboardContainer, - DashboardContainerFactory, -} from '../../../../../../../../src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public'; - import { ErrorEmbeddable, ViewMode, @@ -31,7 +25,12 @@ import { EmbeddablePanel, GetEmbeddableFactory, GetEmbeddableFactories, -} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +} from '../embeddable_api'; +import { + DASHBOARD_CONTAINER_TYPE, + DashboardContainer, + DashboardContainerFactory, +} from '../../../../../../../../src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public'; import { CoreStart } from '../../../../../../../../src/core/public'; import { dashboardInput } from './dashboard_input'; diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_input.ts b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_input.ts index f684974b28b49..011b322612d90 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_input.ts +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_input.ts @@ -17,10 +17,8 @@ * under the License. */ +import { ViewMode, CONTACT_CARD_EMBEDDABLE, HELLO_WORLD_EMBEDDABLE_TYPE } from '../embeddable_api'; import { DashboardContainerInput } from '../../../../../../../../src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public'; -import { CONTACT_CARD_EMBEDDABLE } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; -import { HELLO_WORLD_EMBEDDABLE_TYPE } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable'; -import { ViewMode } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; export const dashboardInput: DashboardContainerInput = { panels: { diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_container_example.tsx b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_container_example.tsx index eb72879eb8f8e..3c0d42b0e13e7 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_container_example.tsx +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_container_example.tsx @@ -20,16 +20,18 @@ import React from 'react'; import { Subscription } from 'rxjs'; import { EuiFieldText, EuiFormRow } from '@elastic/eui'; -import { TGetActionsCompatibleWithTrigger } from '../../../../../../../../src/plugins/ui_actions/public'; -import { CoreStart } from '../../../../../../../../src/core/public'; import { EmbeddablePanel, GetEmbeddableFactory, GetEmbeddableFactories, -} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; -import { HelloWorldContainer } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world_container'; -import { CONTACT_CARD_EMBEDDABLE } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; -import { HELLO_WORLD_EMBEDDABLE_TYPE } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable'; +} from 'src/plugins/embeddable/public'; +import { + HelloWorldContainer, + CONTACT_CARD_EMBEDDABLE, + HELLO_WORLD_EMBEDDABLE_TYPE, +} from 'src/plugins/embeddable/public/lib/test_samples'; +import { TGetActionsCompatibleWithTrigger } from '../../../../../../../../src/plugins/ui_actions/public'; +import { CoreStart } from '../../../../../../../../src/core/public'; import { Start as InspectorStartContract } from '../../../../../../../../src/plugins/inspector/public'; interface Props { diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_embeddable_example.tsx b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_embeddable_example.tsx index 853ceb0322ea6..1cf734d2df947 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_embeddable_example.tsx +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_embeddable_example.tsx @@ -18,13 +18,13 @@ */ import React from 'react'; -import { TGetActionsCompatibleWithTrigger } from '../../../../../../../../src/plugins/ui_actions/public'; import { EmbeddablePanel, GetEmbeddableFactory, GetEmbeddableFactories, -} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; -import { HelloWorldEmbeddable } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable'; +} from 'src/plugins/embeddable/public'; +import { HelloWorldEmbeddable } from 'src/plugins/embeddable/public/lib/test_samples'; +import { TGetActionsCompatibleWithTrigger } from '../../../../../../../../src/plugins/ui_actions/public'; import { CoreStart } from '../../../../../../../../src/core/public'; import { Start as InspectorStartContract } from '../../../../../../../../src/plugins/inspector/public'; diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddable_api.ts b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddable_api.ts index e46bf60dacb4b..3d0dee4018e87 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddable_api.ts +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddable_api.ts @@ -17,4 +17,5 @@ * under the License. */ -export * from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +export * from 'src/plugins/embeddable/public'; +export * from 'src/plugins/embeddable/public/lib/test_samples'; diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddables/hello_world_embeddable_factory.ts b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddables/hello_world_embeddable_factory.ts index 6be4afcb36daf..3cc7b70ce4090 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddables/hello_world_embeddable_factory.ts +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddables/hello_world_embeddable_factory.ts @@ -17,8 +17,10 @@ * under the License. */ -import { setup } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; -import { HelloWorldEmbeddableFactory } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/embeddables/hello_world/hello_world_embeddable_factory'; +// eslint-disable-next-line +import { npSetup } from '../../../../../../../../src/legacy/ui/public/new_platform'; +// eslint-disable-next-line +import { HelloWorldEmbeddableFactory } from '../../../../../../../../src/plugins/embeddable/public/lib/test_samples'; const factory = new HelloWorldEmbeddableFactory(); -setup.registerEmbeddableFactory(factory.type, factory); +npSetup.plugins.embeddable.registerEmbeddableFactory(factory.type, factory); diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/legacy.ts b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/legacy.ts index 1635cda5a7e31..a310403c86b5d 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/legacy.ts +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/legacy.ts @@ -32,15 +32,11 @@ import { uiModules } from 'ui/modules'; import template from './index.html'; import { plugin } from '.'; -import { - setup as embeddableSetup, - start as embeddableStart, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; const pluginInstance = plugin({} as any); export const setup = pluginInstance.setup(npSetup.core, { - embeddable: embeddableSetup, + embeddable: npSetup.plugins.embeddable, inspector: npSetup.plugins.inspector, __LEGACY: { SavedObjectFinder, @@ -64,7 +60,7 @@ uiRoutes.when('/', { }); export const start = pluginInstance.start(npStart.core, { - embeddable: embeddableStart, + embeddable: npStart.plugins.embeddable, inspector: npStart.plugins.inspector, uiActions: npStart.plugins.uiActions, __LEGACY: { diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/plugin.tsx b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/plugin.tsx index dbccdba3b6383..f03b3c4a1e0a5 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/plugin.tsx +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/plugin.tsx @@ -36,7 +36,7 @@ import { createSendMessageAction, HelloWorldEmbeddableFactory, ContactCardEmbeddableFactory, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples'; +} from './embeddable_api'; import { App } from './app'; export interface SetupDependencies { diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx index 334d3bdc4ac48..71724595d462a 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx @@ -20,10 +20,7 @@ import { EuiFlyoutBody, EuiFlyoutHeader, EuiTitle } from '@elastic/eui'; import React from 'react'; import { npStart, npSetup } from 'ui/new_platform'; -import { - CONTEXT_MENU_TRIGGER, - IEmbeddable, -} from '../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { CONTEXT_MENU_TRIGGER, IEmbeddable } from '../../../../../src/plugins/embeddable/public'; import { createAction } from '../../../../../src/plugins/ui_actions/public'; interface ActionContext { diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_link.ts b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_link.ts index c020559cfb792..f042d466c794a 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_link.ts +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_link.ts @@ -18,7 +18,7 @@ */ import { npStart } from 'ui/new_platform'; import { IAction, createAction } from '../../../../../src/plugins/ui_actions/public'; -import { CONTEXT_MENU_TRIGGER } from '../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { CONTEXT_MENU_TRIGGER } from '../../../../../src/plugins/embeddable/public'; export const createSamplePanelLink = (): IAction => createAction({ diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.test.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.test.ts index fe6a37c92f84b..9d5d3be101244 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.test.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.test.ts @@ -4,10 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ import { canInheritTimeRange } from './can_inherit_time_range'; +/** eslint-disable */ import { HelloWorldEmbeddable, HelloWorldContainer, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples'; +} from 'src/plugins/embeddable/public/lib/test_samples'; +/** eslint-enable */ import { TimeRangeEmbeddable, TimeRangeContainer } from './test_helpers'; jest.mock('ui/new_platform'); diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.ts index 221fdc314f8c8..09d8d26998e95 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.ts @@ -4,12 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { Embeddable, IContainer, ContainerInput } from 'src/plugins/embeddable/public'; import { TimeRange } from '../../../../../../../src/plugins/data/public'; -import { - Embeddable, - IContainer, - ContainerInput, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { TimeRangeInput } from './custom_time_range_action'; interface ContainerTimeRangeInput extends ContainerInput { diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.test.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.test.ts index a2d20399ec6ca..4b9eb8dc5fc26 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.test.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.test.ts @@ -10,17 +10,19 @@ import { skip } from 'rxjs/operators'; import * as Rx from 'rxjs'; import { mount } from 'enzyme'; -import { EmbeddableFactory } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { EmbeddableFactory } from 'src/plugins/embeddable/public'; import { TimeRangeEmbeddable, TimeRangeContainer, TIME_RANGE_EMBEDDABLE } from './test_helpers'; import { TimeRangeEmbeddableFactory } from './test_helpers/time_range_embeddable_factory'; import { CustomTimeRangeAction } from './custom_time_range_action'; import { coreMock } from '../../../../../../../src/core/public/mocks'; +/* eslint-disable */ import { HelloWorldEmbeddableFactory, HELLO_WORLD_EMBEDDABLE_TYPE, HelloWorldEmbeddable, HelloWorldContainer, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples'; +} from 'src/plugins/embeddable/public/lib/test_samples'; +/* eslint-enable */ import { nextTick } from 'test_utils/enzyme_helpers'; import { ReactElement } from 'react'; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.tsx b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.tsx index f98e18fbf0e9e..a9ab5edea4a25 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.tsx +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.tsx @@ -6,6 +6,7 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; +import { IEmbeddable, Embeddable, EmbeddableInput } from 'src/plugins/embeddable/public'; import { IAction, IncompatibleActionError, @@ -15,12 +16,6 @@ import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../../../src/legacy/core_plu import { VisualizeEmbeddable } from '../../../../../../../src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable'; import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../../../src/legacy/core_plugins/kibana/public/visualize/embeddable/constants'; -import { - IEmbeddable, - Embeddable, - EmbeddableInput, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; - import { CustomizeTimeRangeModal } from './customize_time_range_modal'; import { OpenModal, CommonlyUsedRange } from './types'; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.test.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.test.ts index 33a6adb61775a..925a3fbfcfeca 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.test.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.test.ts @@ -10,7 +10,7 @@ import { skip } from 'rxjs/operators'; import * as Rx from 'rxjs'; import { mount } from 'enzyme'; -import { EmbeddableFactory } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { EmbeddableFactory } from 'src/plugins/embeddable/public'; import { TimeRangeEmbeddable, TimeRangeContainer, TIME_RANGE_EMBEDDABLE } from './test_helpers'; import { TimeRangeEmbeddableFactory } from './test_helpers/time_range_embeddable_factory'; import { CustomTimeRangeBadge } from './custom_time_range_badge'; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.tsx b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.tsx index 29d8711297873..13fdbb17e1070 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.tsx +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.tsx @@ -7,16 +7,12 @@ import React from 'react'; import { prettyDuration, commonDurationRanges } from '@elastic/eui'; +import { IEmbeddable, Embeddable, EmbeddableInput } from 'src/plugins/embeddable/public'; import { IAction, IncompatibleActionError, } from '../../../../../../../src/plugins/ui_actions/public'; import { TimeRange } from '../../../../../../../src/plugins/data/public'; -import { - IEmbeddable, - Embeddable, - EmbeddableInput, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { CustomizeTimeRangeModal } from './customize_time_range_modal'; import { doesInheritTimeRange } from './does_inherit_time_range'; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/customize_time_range_modal.tsx b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/customize_time_range_modal.tsx index dfa5768a4f859..26ff149599812 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/customize_time_range_modal.tsx +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/customize_time_range_modal.tsx @@ -19,12 +19,8 @@ import { EuiFlexItem, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { Embeddable, IContainer, ContainerInput } from 'src/plugins/embeddable/public'; import { TimeRange } from '../../../../../../../src/plugins/data/public'; -import { - Embeddable, - IContainer, - ContainerInput, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { TimeRangeInput } from './custom_time_range_action'; import { doesInheritTimeRange } from './does_inherit_time_range'; import { CommonlyUsedRange } from './types'; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/does_inherit_time_range.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/does_inherit_time_range.ts index aa960c45e20d6..6b4033db34580 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/does_inherit_time_range.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/does_inherit_time_range.ts @@ -4,11 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - Embeddable, - IContainer, - ContainerInput, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { Embeddable, IContainer, ContainerInput } from 'src/plugins/embeddable/public'; import { TimeRangeInput } from './custom_time_range_action'; export function doesInheritTimeRange(embeddable: Embeddable) { diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/legacy.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/legacy.ts index 65580d25d08ce..535e55d71d349 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/legacy.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/legacy.ts @@ -10,16 +10,12 @@ import { npSetup, npStart } from 'ui/new_platform'; import { plugin } from '.'; -import { - setup as embeddableSetup, - start as embeddableStart, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; - const pluginInstance = plugin({} as any); export const setup = pluginInstance.setup(npSetup.core, { - embeddable: embeddableSetup, + embeddable: npSetup.plugins.embeddable, + uiActions: npSetup.plugins.uiActions, }); export const start = pluginInstance.start(npStart.core, { - embeddable: embeddableStart, + embeddable: npStart.plugins.embeddable, uiActions: npStart.plugins.uiActions, }); diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/plugin.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/plugin.ts index 871d9f9536285..b698fdf4f093f 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/plugin.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/plugin.ts @@ -5,12 +5,12 @@ */ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core/public'; -import { IUiActionsStart } from 'src/plugins/ui_actions/public'; +import { IUiActionsStart, IUiActionsSetup } from 'src/plugins/ui_actions/public'; import { Plugin as EmbeddablePlugin, CONTEXT_MENU_TRIGGER, PANEL_BADGE_TRIGGER, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +} from 'src/plugins/embeddable/public'; import { CustomTimeRangeAction } from './custom_time_range_action'; import { CustomTimeRangeBadge } from './custom_time_range_badge'; @@ -18,6 +18,7 @@ import { CommonlyUsedRange } from './types'; interface SetupDependencies { embeddable: ReturnType; + uiActions: IUiActionsSetup; } interface StartDependencies { diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_container.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_container.ts index 0227e97fe3537..bda819f8658d4 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_container.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_container.ts @@ -4,13 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { TimeRange } from '../../../../../../../../src/plugins/data/public'; import { ContainerInput, Container, ContainerOutput, GetEmbeddableFactory, -} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +} from 'src/plugins/embeddable/public'; +import { TimeRange } from '../../../../../../../../src/plugins/data/public'; /** * interfaces are not allowed to specify a sub-set of the required types until diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable.ts index 7fb8c390f720c..103f7029c0ed3 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable.ts @@ -4,13 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { TimeRange } from '../../../../../../../../src/plugins/data/public'; import { EmbeddableOutput, Embeddable, EmbeddableInput, IContainer, -} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +} from 'src/plugins/embeddable/public'; +import { TimeRange } from '../../../../../../../../src/plugins/data/public'; interface EmbeddableTimeRangeInput extends EmbeddableInput { timeRange: TimeRange; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable_factory.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable_factory.ts index f4dcaa1e935ad..e91f907e6fce0 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable_factory.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable_factory.ts @@ -4,12 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { EmbeddableInput, IContainer, EmbeddableFactory } from 'src/plugins/embeddable/public'; import { TimeRange } from '../../../../../../../../src/plugins/data/public'; -import { - EmbeddableInput, - IContainer, - EmbeddableFactory, -} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { TIME_RANGE_EMBEDDABLE, TimeRangeEmbeddable } from './time_range_embeddable'; interface EmbeddableTimeRangeInput extends EmbeddableInput { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts index cad46e81ffc0c..21c97d88e3d98 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts @@ -5,7 +5,7 @@ */ import { ExpressionType } from 'src/plugins/expressions/common'; -import { EmbeddableInput } from 'src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { EmbeddableInput } from 'src/plugins/embeddable/public'; import { EmbeddableTypes } from './embeddable_types'; export const EmbeddableExpressionType = 'embeddable'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts index c36a05e405704..01aaa426d1b35 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts @@ -6,7 +6,7 @@ import { Filter as ESFilterType } from '@kbn/es-query'; import { ExpressionFunction } from 'src/legacy/core_plugins/interpreter/public'; import { TimeRange } from 'src/plugins/data/public'; -import { EmbeddableInput } from 'src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { EmbeddableInput } from 'src/plugins/embeddable/public'; import { buildEmbeddableFilters } from '../../../server/lib/build_embeddable_filters'; import { Filter } from '../../../types'; import { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable.tsx b/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable.tsx index 8df365d661aef..395a6d97daca6 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable.tsx +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable.tsx @@ -13,8 +13,7 @@ import { EmbeddablePanel, EmbeddableFactoryNotFoundError, EmbeddableInput, -} from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; -import { start } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; +} from '../../../../../../src/plugins/embeddable/public'; import { EmbeddableExpression } from '../expression_types/embeddable'; import { SavedObjectFinder } from '../../../../../../src/legacy/ui/public/saved_objects/components/saved_object_finder'; @@ -40,8 +39,8 @@ const renderEmbeddable = (embeddableObject: IEmbeddable, domNode: HTMLElement) = ({ handlers: Handlers ) => { if (!embeddablesRegistry[input.id]) { - const factory = Array.from(start.getEmbeddableFactories()).find( + const factory = Array.from(npStart.plugins.embeddable.getEmbeddableFactories()).find( embeddableFactory => embeddableFactory.type === embeddableType ); diff --git a/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx b/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx index 0f03657e970bb..d09000dbcc280 100644 --- a/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx +++ b/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx @@ -11,7 +11,7 @@ import { SavedObjectMetaData, } from 'ui/saved_objects/components/saved_object_finder'; import { EuiFlyout, EuiFlyoutHeader, EuiFlyoutBody, EuiTitle } from '@elastic/eui'; -import { start } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; +import { npStart } from 'ui/new_platform'; import { ComponentStrings } from '../../../i18n'; const { AddEmbeddableFlyout: strings } = ComponentStrings; @@ -24,7 +24,7 @@ export interface Props { export class AddEmbeddableFlyout extends React.Component { onAddPanel = (id: string, savedObjectType: string, name: string) => { - const embeddableFactories = start.getEmbeddableFactories(); + const embeddableFactories = npStart.plugins.embeddable.getEmbeddableFactories(); // Find the embeddable type from the saved object type const found = Array.from(embeddableFactories).find(embeddableFactory => { @@ -40,7 +40,7 @@ export class AddEmbeddableFlyout extends React.Component { }; render() { - const embeddableFactories = start.getEmbeddableFactories(); + const embeddableFactories = npStart.plugins.embeddable.getEmbeddableFactories(); const availableSavedObjects = Array.from(embeddableFactories) .filter(factory => { diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable.tsx b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable.tsx index e815a1951bdb7..5b4accb3bf401 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable.tsx +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable.tsx @@ -18,7 +18,7 @@ import { EmbeddableOutput, IContainer, EmbeddableInput, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +} from '../../../../../../../src/plugins/embeddable/public'; import { Document, DOC_TYPE } from '../../persistence'; import { ExpressionWrapper } from './expression_wrapper'; diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable_factory.ts b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable_factory.ts index c340342a31ff6..fee69de844ef6 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable_factory.ts +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable_factory.ts @@ -16,7 +16,7 @@ import { ErrorEmbeddable, EmbeddableInput, IContainer, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +} from '../../../../../../../src/plugins/embeddable/public'; import { Embeddable } from './embeddable'; import { SavedObjectIndexStore, DOC_TYPE } from '../../persistence'; import { getEditPath } from '../../../common'; diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/plugin.tsx b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/plugin.tsx index e27c2e54500cf..4e6ce2cf3fc8a 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/plugin.tsx +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/plugin.tsx @@ -10,8 +10,7 @@ import { I18nProvider } from '@kbn/i18n/react'; import { CoreSetup, CoreStart } from 'src/core/public'; import chrome, { Chrome } from 'ui/chrome'; import { npSetup, npStart } from 'ui/new_platform'; -import { Plugin as EmbeddablePlugin } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; -import { start as embeddablePlugin } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; +import { Plugin as EmbeddablePlugin } from '../../../../../../src/plugins/embeddable/public'; import { setup as dataSetup, start as dataStart, @@ -40,7 +39,7 @@ export interface EditorFrameSetupPlugins { export interface EditorFrameStartPlugins { data: typeof dataStart; expressions: typeof expressionsStart; - embeddables: ReturnType; + embeddable: ReturnType; chrome: Chrome; } @@ -64,7 +63,7 @@ export class EditorFramePlugin { } public start(core: CoreStart, plugins: EditorFrameStartPlugins): EditorFrameStart { - plugins.embeddables.registerEmbeddableFactory( + plugins.embeddable.registerEmbeddableFactory( 'lens', new EmbeddableFactory( plugins.chrome, @@ -134,7 +133,7 @@ export const editorFrameStart = () => data: dataStart, expressions: expressionsStart, chrome, - embeddables: embeddablePlugin, + embeddable: npStart.plugins.embeddable, }); export const editorFrameStop = () => editorFrame.stop(); diff --git a/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx b/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx index fd33bc79eeaf8..99610d0023b42 100644 --- a/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx +++ b/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx @@ -12,13 +12,9 @@ import { toastNotifications } from 'ui/notify'; import chrome from 'ui/chrome'; import { npSetup } from 'ui/new_platform'; +import { ViewMode, IEmbeddable, CONTEXT_MENU_TRIGGER } from 'src/plugins/embeddable/public'; import { IAction, IncompatibleActionError } from '../../../../../../src/plugins/ui_actions/public'; -import { - ViewMode, - IEmbeddable, - CONTEXT_MENU_TRIGGER, -} from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { ISearchEmbeddable, SEARCH_EMBEDDABLE_TYPE, diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx index bdbfad15a9810..95861118e759e 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx @@ -14,11 +14,7 @@ import { } from './apply_siem_filter_action'; // @ts-ignore Missing type defs as maps moves to Typescript import { MAP_SAVED_OBJECT_TYPE } from '../../../../../maps/common/constants'; -import { - EmbeddableInput, - EmbeddableOutput, - IEmbeddable, -} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables'; +import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from 'src/plugins/embeddable/public'; import { Filter } from '@kbn/es-query'; // Using type narrowing to remove all the any's -- https://github.com/elastic/kibana/pull/43965/files#r318796100 diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx index 0ea87ecaed0e8..0dac950656429 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx @@ -8,9 +8,9 @@ import { Filter } from '@kbn/es-query'; import { getOr } from 'lodash/fp'; import { i18n } from '@kbn/i18n'; import { IAction } from 'src/plugins/ui_actions/public'; +import { IEmbeddable } from 'src/plugins/embeddable/public'; // @ts-ignore Missing type defs as maps moves to Typescript import { MAP_SAVED_OBJECT_TYPE } from '../../../../../maps/common/constants'; -import { IEmbeddable } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables'; export const APPLY_SIEM_FILTER_ACTION_ID = 'APPLY_SIEM_FILTER_ACTION_ID'; diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx index 86696503dbda3..449bde36cc536 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx @@ -10,8 +10,7 @@ import { npStart } from 'ui/new_platform'; import { SavedObjectFinder } from 'ui/saved_objects/components/saved_object_finder'; import styled from 'styled-components'; -import { start } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; -import { EmbeddablePanel } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { EmbeddablePanel } from 'src/plugins/embeddable/public'; import { Loader } from '../loader'; import { useIndexPatterns } from '../ml_popover/hooks/use_index_patterns'; @@ -135,8 +134,8 @@ export const EmbeddedMap = React.memo( data-test-subj="embeddable-panel" embeddable={embeddable} getActions={npStart.plugins.uiActions.getTriggerCompatibleActions} - getEmbeddableFactory={start.getEmbeddableFactory} - getAllEmbeddableFactories={start.getEmbeddableFactories} + getEmbeddableFactory={npStart.plugins.embeddable.getEmbeddableFactory} + getAllEmbeddableFactories={npStart.plugins.embeddable.getEmbeddableFactories} notifications={npStart.core.notifications} overlays={npStart.core.overlays} inspector={npStart.plugins.inspector} diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx index cb1fa30fce26e..73562c9734546 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx @@ -6,21 +6,20 @@ import uuid from 'uuid'; import { npStart } from 'ui/new_platform'; -import { ActionToaster, AppToast } from '../toasters'; -import { start } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; import { + ViewMode, + APPLY_FILTER_ACTION, APPLY_FILTER_TRIGGER, CONTEXT_MENU_TRIGGER, PANEL_BADGE_TRIGGER, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/triggers'; +} from 'src/plugins/embeddable/public'; +import { ActionToaster, AppToast } from '../toasters'; import { APPLY_SIEM_FILTER_ACTION_ID, ApplySiemFilterAction, } from './actions/apply_siem_filter_action'; -import { APPLY_FILTER_ACTION } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/actions'; import { IndexPatternMapping, MapEmbeddable, SetQuery } from './types'; import { getLayerList } from './map_config'; -import { ViewMode } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; // @ts-ignore Missing type defs as maps moves to Typescript import { MAP_SAVED_OBJECT_TYPE } from '../../../../maps/common/constants'; import * as i18n from './translations'; @@ -98,7 +97,7 @@ export const createEmbeddable = async ( endDate: number, setQuery: SetQuery ): Promise => { - const factory = start.getEmbeddableFactory(MAP_SAVED_OBJECT_TYPE); + const factory = npStart.plugins.embeddable.getEmbeddableFactory(MAP_SAVED_OBJECT_TYPE); const state = { layerList: getLayerList(indexPatterns), diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/types.ts b/x-pack/legacy/plugins/siem/public/components/embeddables/types.ts index 2f401ba841a93..1f4d53b26a6f4 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/types.ts +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/types.ts @@ -6,11 +6,7 @@ import { Filter as ESFilterType } from '@kbn/es-query'; import { TimeRange } from 'src/plugins/data/public'; -import { - EmbeddableInput, - EmbeddableOutput, - IEmbeddable, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from 'src/plugins/embeddable/public'; import { inputsModel } from '../../store/inputs'; export interface MapEmbeddableInput extends EmbeddableInput { From 212abd889f16605df6868fa8d4dcfdf27ef52e48 Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 15:30:05 +0200 Subject: [PATCH 03/14] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20TypeScript=20?= =?UTF-8?q?and=20build=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../np_ready/public/lib/embeddable_api.ts | 2 +- .../dashboard/dashboard_app_controller.tsx | 2 +- .../dashboard/dashboard_state_manager.ts | 2 +- .../public/dashboard/dashboard_strings.ts | 2 +- .../dashboard/lib/get_app_state_defaults.ts | 2 +- .../dashboard/top_nav/get_top_nav_config.ts | 2 +- .../discover/embeddable/search_embeddable.ts | 6 +++++- .../embeddable/search_embeddable_factory.ts | 6 +++++- .../embeddable/disabled_lab_embeddable.tsx | 2 +- .../embeddable/visualize_embeddable.ts | 4 ++-- .../visualize_embeddable_factory.tsx | 4 ++-- src/plugins/embeddable/kibana.json | 3 ++- .../public/lib/actions/apply_filter_action.ts | 2 +- .../embeddable/public/lib/inspector.ts | 20 +++++++++++++++++++ .../public/lib/panel/embeddable_panel.tsx | 6 +++--- .../panel_actions/remove_panel_action.ts | 2 +- src/plugins/embeddable/public/lib/types.ts | 2 +- .../embeddable/public/lib/ui_actions.ts | 20 +++++++++++++++++++ .../public/np_ready/kibana.json | 3 ++- .../public/np_ready/public/plugin.ts | 13 ++++++------ .../maps/public/embeddable/map_embeddable.js | 2 +- .../embeddable/map_embeddable_factory.js | 6 +++--- .../panel_actions/get_csv_panel_action.tsx | 6 +++++- .../components/embeddables/embedded_map.tsx | 2 +- .../embeddables/embedded_map_helpers.tsx | 2 +- 25 files changed, 89 insertions(+), 34 deletions(-) create mode 100644 src/plugins/embeddable/public/lib/inspector.ts create mode 100644 src/plugins/embeddable/public/lib/ui_actions.ts diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts index 2ad99f830aa62..9f9fd47ad1ebf 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts @@ -17,4 +17,4 @@ * under the License. */ -export * from 'src/plugins/embeddable/public'; +export * from '../../../../../../../../src/plugins/embeddable/public'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx index 14d3ad8e90424..7095c8d790cdc 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx @@ -62,7 +62,7 @@ import { ErrorEmbeddable, ViewMode, openAddPanelFlyout, -} from 'src/plugins/embeddable/public'; +} from '../../../../../../src/plugins/embeddable/public'; import { data } from '../../../data/public/setup'; import { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts index b7f30b7adc35e..c1ce5b764f2f6 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts @@ -28,7 +28,7 @@ import { migrateLegacyQuery } from 'ui/utils/migrate_legacy_query'; import { Moment } from 'moment'; import { DashboardContainer } from 'src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public'; -import { ViewMode } from 'src/plugins/embeddable/public'; +import { ViewMode } from '../../../../../../src/plugins/embeddable/public'; import { Query } from '../../../data/public'; import { getAppStateDefaults, migrateAppState } from './lib'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts index 80d727c7f9ade..b7f9293539abd 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts @@ -18,7 +18,7 @@ */ import { i18n } from '@kbn/i18n'; -import { ViewMode } from 'src/plugins/embeddable/public'; +import { ViewMode } from '../../../../../../src/plugins/embeddable/public'; /** * @param title {string} the current title of the dashboard diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts b/src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts index b96e4bb04703a..eb4a4356fb27a 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ViewMode } from 'src/plugins/embeddable/public'; +import { ViewMode } from '../../../../../../../src/plugins/embeddable/public'; import { SavedObjectDashboard } from '../saved_dashboard/saved_dashboard'; import { DashboardAppStateDefaults } from '../types'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/top_nav/get_top_nav_config.ts b/src/legacy/core_plugins/kibana/public/dashboard/top_nav/get_top_nav_config.ts index 5996980c55e8c..0606cc4f7bdad 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/top_nav/get_top_nav_config.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/top_nav/get_top_nav_config.ts @@ -18,7 +18,7 @@ */ import { i18n } from '@kbn/i18n'; -import { ViewMode } from 'src/plugins/embeddable/public'; +import { ViewMode } from '../../../../../../plugins/embeddable/public'; import { TopNavIds } from './top_nav_ids'; import { NavAction } from '../types'; diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts index 5d5427bc671db..c180efc8df093 100644 --- a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts +++ b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts @@ -37,7 +37,11 @@ import { i18n } from '@kbn/i18n'; import { toastNotifications } from 'ui/notify'; import { TimeRange } from 'src/plugins/data/public'; import { TExecuteTriggerActions } from 'src/plugins/ui_actions/public'; -import { APPLY_FILTER_TRIGGER, Embeddable, Container } from 'src/plugins/embeddable/public'; +import { + APPLY_FILTER_TRIGGER, + Embeddable, + Container, +} from '../../../../../../plugins/embeddable/public'; import { setup as data } from '../../../../data/public/legacy'; import { Query, onlyDisabledFiltersChanged, getTime } from '../../../../data/public'; import * as columnActions from '../doc_table/actions/columns'; diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts index 04e2bef4d48ea..d7b51b39e2a16 100644 --- a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts +++ b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts @@ -26,7 +26,11 @@ import { IPrivate } from 'ui/private'; import { TimeRange } from 'src/plugins/data/public'; import { FilterBarQueryFilterProvider } from 'ui/filter_manager/query_filter'; import { TExecuteTriggerActions } from 'src/plugins/ui_actions/public'; -import { EmbeddableFactory, ErrorEmbeddable, Container } from 'src/plugins/embeddable/public'; +import { + EmbeddableFactory, + ErrorEmbeddable, + Container, +} from '../../../../../../plugins/embeddable/public'; import { SavedSearchLoader } from '../types'; import { SearchEmbeddable, SEARCH_EMBEDDABLE_TYPE } from './search_embeddable'; import { SearchInput, SearchOutput } from './types'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx b/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx index 902fa1da04e1a..92bd0fa345fa0 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx @@ -19,7 +19,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { Embeddable, EmbeddableOutput } from 'src/plugins/embeddable/public'; +import { Embeddable, EmbeddableOutput } from '../../../../../../plugins/embeddable/public'; import { DisabledLabVisualization } from './disabled_lab_visualization'; import { VisualizeInput } from './visualize_embeddable'; import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts b/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts index ce5ea7fcb4335..b9febc3af54ea 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts @@ -29,14 +29,14 @@ import { } from 'ui/visualize/loader/types'; import { Subscription } from 'rxjs'; import * as Rx from 'rxjs'; -import { TimeRange } from 'src/plugins/data/public'; import { Filter } from '@kbn/es-query'; +import { TimeRange } from '../../../../../../plugins/data/public'; import { EmbeddableInput, EmbeddableOutput, Embeddable, Container, -} from 'src/plugins/embeddable/public'; +} from '../../../../../../plugins/embeddable/public'; import { Query, onlyDisabledFiltersChanged } from '../../../../data/public'; import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; 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 3b5c28b2caabb..21897cb6c0d15 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 @@ -47,13 +47,13 @@ import { VisTypesRegistry, VisTypesRegistryProvider } from 'ui/registry/vis_type import { IPrivate } from 'ui/private'; import { SavedObjectAttributes } from 'kibana/server'; +import { npSetup } from 'ui/new_platform'; import { EmbeddableFactory, ErrorEmbeddable, Container, EmbeddableOutput, -} from 'src/plugins/embeddable/public'; -import { npSetup } from 'ui/new_platform'; +} from '../../../../../../plugins/embeddable/public'; import { showNewVisModal } from '../wizard'; import { SavedVisualizations } from '../types'; import { DisabledLabEmbeddable } from './disabled_lab_embeddable'; diff --git a/src/plugins/embeddable/kibana.json b/src/plugins/embeddable/kibana.json index d5cd7957b856a..535527b4d09db 100644 --- a/src/plugins/embeddable/kibana.json +++ b/src/plugins/embeddable/kibana.json @@ -4,6 +4,7 @@ "server": false, "ui": true, "requiredPlugins": [ - "inspector" + "inspector", + "uiActions" ] } diff --git a/src/plugins/embeddable/public/lib/actions/apply_filter_action.ts b/src/plugins/embeddable/public/lib/actions/apply_filter_action.ts index 0adb882a9006b..99cfb2ea13d07 100644 --- a/src/plugins/embeddable/public/lib/actions/apply_filter_action.ts +++ b/src/plugins/embeddable/public/lib/actions/apply_filter_action.ts @@ -19,7 +19,7 @@ import { i18n } from '@kbn/i18n'; import { Filter } from '@kbn/es-query'; -import { IAction, createAction, IncompatibleActionError } from 'src/plugins/ui_actions/public'; +import { IAction, createAction, IncompatibleActionError } from '../ui_actions'; import { IEmbeddable, EmbeddableInput } from '../embeddables'; export const APPLY_FILTER_ACTION = 'APPLY_FILTER_ACTION'; diff --git a/src/plugins/embeddable/public/lib/inspector.ts b/src/plugins/embeddable/public/lib/inspector.ts new file mode 100644 index 0000000000000..9ac75a51b2cae --- /dev/null +++ b/src/plugins/embeddable/public/lib/inspector.ts @@ -0,0 +1,20 @@ +/* + * 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. + */ + +export * from '../../../inspector/public'; diff --git a/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx index 2f11c59269f09..3f3729645b7e2 100644 --- a/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx +++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx @@ -24,10 +24,10 @@ import { buildContextMenuForActions, TGetActionsCompatibleWithTrigger, IAction, -} from 'src/plugins/ui_actions/public'; -import { CoreStart } from 'src/core/public'; +} from '../ui_actions'; +import { CoreStart } from '../../../../../core/public'; -import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; +import { Start as InspectorStartContract } from '../inspector'; import { CONTEXT_MENU_TRIGGER, PANEL_BADGE_TRIGGER } from '../triggers'; import { IEmbeddable } from '../embeddables/i_embeddable'; import { ViewMode, GetEmbeddableFactory, GetEmbeddableFactories } from '../types'; diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts index 98849f2b59d0e..498cd8d7136c6 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/remove_panel_action.ts @@ -17,7 +17,7 @@ * under the License. */ import { i18n } from '@kbn/i18n'; -import { IAction, IncompatibleActionError } from 'src/plugins/ui_actions/public'; +import { IAction, IncompatibleActionError } from '../../../ui_actions'; import { ContainerInput, IContainer } from '../../../containers'; import { ViewMode } from '../../../types'; import { IEmbeddable } from '../../../embeddables'; diff --git a/src/plugins/embeddable/public/lib/types.ts b/src/plugins/embeddable/public/lib/types.ts index 1518c6ae8b26e..e098d8f384820 100644 --- a/src/plugins/embeddable/public/lib/types.ts +++ b/src/plugins/embeddable/public/lib/types.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Adapters } from 'src/plugins/inspector/public'; +import { Adapters } from './inspector'; import { EmbeddableFactory } from './embeddables/embeddable_factory'; export interface Trigger { diff --git a/src/plugins/embeddable/public/lib/ui_actions.ts b/src/plugins/embeddable/public/lib/ui_actions.ts new file mode 100644 index 0000000000000..130a7a78e9d46 --- /dev/null +++ b/src/plugins/embeddable/public/lib/ui_actions.ts @@ -0,0 +1,20 @@ +/* + * 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. + */ + +export * from '../../../ui_actions/public'; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/kibana.json b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/kibana.json index f0303e7ad6a7a..fd2c7ad1130c1 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/kibana.json +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/kibana.json @@ -2,7 +2,8 @@ "id": "advanced_ui_actions", "version": "kibana", "requiredPlugins": [ - "embeddable" + "embeddable", + "ui_actions" ], "server": false, "ui": true diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/plugin.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/plugin.ts index b698fdf4f093f..f1b87f6c694a1 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/plugin.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/plugin.ts @@ -7,22 +7,23 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core/public'; import { IUiActionsStart, IUiActionsSetup } from 'src/plugins/ui_actions/public'; import { - Plugin as EmbeddablePlugin, CONTEXT_MENU_TRIGGER, PANEL_BADGE_TRIGGER, -} from 'src/plugins/embeddable/public'; + Setup as EmbeddableSetup, + Start as EmbeddableStart, +} from '../../../../../../../src/plugins/embeddable/public'; import { CustomTimeRangeAction } from './custom_time_range_action'; import { CustomTimeRangeBadge } from './custom_time_range_badge'; import { CommonlyUsedRange } from './types'; interface SetupDependencies { - embeddable: ReturnType; + embeddable: EmbeddableSetup; // Embeddable are needed because they register basic triggers/actions. uiActions: IUiActionsSetup; } interface StartDependencies { - embeddable: ReturnType; + embeddable: EmbeddableStart; uiActions: IUiActionsStart; } @@ -33,9 +34,9 @@ export class AdvancedUiActionsPublicPlugin implements Plugin { constructor(initializerContext: PluginInitializerContext) {} - public setup(core: CoreSetup, { embeddable }: SetupDependencies): Setup {} + public setup(core: CoreSetup, { uiActions }: SetupDependencies): Setup {} - public start(core: CoreStart, { embeddable, uiActions }: StartDependencies): Start { + public start(core: CoreStart, { uiActions }: StartDependencies): Start { const dateFormat = core.uiSettings.get('dateFormat') as string; const commonlyUsedRanges = core.uiSettings.get('timepicker:quickRanges') as CommonlyUsedRange[]; const timeRangeAction = new CustomTimeRangeAction({ diff --git a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.js b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.js index cccd169436efc..dd46c8954178c 100644 --- a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.js +++ b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.js @@ -10,7 +10,7 @@ import { Provider } from 'react-redux'; import { render, unmountComponentAtNode } from 'react-dom'; import 'mapbox-gl/dist/mapbox-gl.css'; -import { Embeddable, APPLY_FILTER_TRIGGER } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { Embeddable, APPLY_FILTER_TRIGGER } from '../../../../../../src/plugins/embeddable/public'; import { onlyDisabledFiltersChanged } from '../../../../../../src/legacy/core_plugins/data/public'; import { I18nContext } from 'ui/i18n'; diff --git a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js index 5fe1094b75e5c..f7ca1e1d448a4 100644 --- a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js +++ b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js @@ -6,13 +6,13 @@ import _ from 'lodash'; import chrome from 'ui/chrome'; +import { npSetup } from 'ui/new_platform'; import { capabilities } from 'ui/capabilities'; import { i18n } from '@kbn/i18n'; import { EmbeddableFactory, ErrorEmbeddable -} from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; -import { setup } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; +} from '../../../../../../src/plugins/embeddable/public'; import { MapEmbeddable } from './map_embeddable'; import { indexPatternService } from '../kibana_services'; @@ -145,4 +145,4 @@ export class MapEmbeddableFactory extends EmbeddableFactory { } } -setup.registerEmbeddableFactory(MAP_SAVED_OBJECT_TYPE, new MapEmbeddableFactory()); +npSetup.plugins.embeddable.registerEmbeddableFactory(MAP_SAVED_OBJECT_TYPE, new MapEmbeddableFactory()); diff --git a/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx b/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx index 99610d0023b42..2b4241caaa051 100644 --- a/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx +++ b/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx @@ -12,7 +12,11 @@ import { toastNotifications } from 'ui/notify'; import chrome from 'ui/chrome'; import { npSetup } from 'ui/new_platform'; -import { ViewMode, IEmbeddable, CONTEXT_MENU_TRIGGER } from 'src/plugins/embeddable/public'; +import { + ViewMode, + IEmbeddable, + CONTEXT_MENU_TRIGGER, +} from '../../../../../../src/plugins/embeddable/public'; import { IAction, IncompatibleActionError } from '../../../../../../src/plugins/ui_actions/public'; import { diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx index 449bde36cc536..42254e37097d0 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx @@ -10,7 +10,7 @@ import { npStart } from 'ui/new_platform'; import { SavedObjectFinder } from 'ui/saved_objects/components/saved_object_finder'; import styled from 'styled-components'; -import { EmbeddablePanel } from 'src/plugins/embeddable/public'; +import { EmbeddablePanel } from '../../../../../../../src/plugins/embeddable/public'; import { Loader } from '../loader'; import { useIndexPatterns } from '../ml_popover/hooks/use_index_patterns'; diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx index 73562c9734546..f5df4be879c90 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx @@ -12,7 +12,7 @@ import { APPLY_FILTER_TRIGGER, CONTEXT_MENU_TRIGGER, PANEL_BADGE_TRIGGER, -} from 'src/plugins/embeddable/public'; +} from '../../../../../../../src/plugins/embeddable/public'; import { ActionToaster, AppToast } from '../toasters'; import { APPLY_SIEM_FILTER_ACTION_ID, From 6a4bdb2c5c5c765a42c7563d1ce0c2b33c608e5c Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 15:46:23 +0200 Subject: [PATCH 04/14] =?UTF-8?q?test:=20=F0=9F=92=8D=20fix=20Jest=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../panel_actions/add_panel/add_panel_action.test.tsx | 2 +- .../panel_actions/add_panel/add_panel_flyout.test.tsx | 2 +- src/plugins/embeddable/public/tests/container.test.ts | 2 +- .../embeddable/public/tests/customize_panel_modal.test.tsx | 2 +- src/plugins/embeddable/public/tests/explicit_input.test.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx index 82a263932f2cb..802be5bf1282e 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx @@ -30,7 +30,7 @@ import { FilterableEmbeddableFactory } from '../../../../test_samples/embeddable import { FilterableContainer } from '../../../../test_samples/embeddables/filterable_container'; import { GetEmbeddableFactory } from '../../../../types'; // eslint-disable-next-line -import { coreMock } from 'src/core/public/mocks'; +import { coreMock } from '../../../../../../../../core/public/mocks'; import { ContactCardEmbeddable } from '../../../../test_samples'; const embeddableFactories = new Map(); diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx index 036ca46bf6384..dd55cd1eacdc2 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx @@ -33,7 +33,7 @@ import { mount } from 'enzyme'; import { findTestSubject } from '@elastic/eui/lib/test'; // eslint-disable-next-line -import { coreMock } from 'src/core/public/mocks'; +import { coreMock } from '../../../../../../../../core/public/mocks'; test('createNewEmbeddable() add embeddable to container', async () => { const core = coreMock.createStart(); diff --git a/src/plugins/embeddable/public/tests/container.test.ts b/src/plugins/embeddable/public/tests/container.test.ts index e2b31176e07d3..c2044057786ae 100644 --- a/src/plugins/embeddable/public/tests/container.test.ts +++ b/src/plugins/embeddable/public/tests/container.test.ts @@ -44,7 +44,7 @@ import { FilterableContainerInput, } from '../lib/test_samples/embeddables/filterable_container'; // eslint-disable-next-line -import { coreMock } from 'src/core/public/mocks'; +import { coreMock } from '../../../../core/public/mocks'; import { testPlugin } from './test_plugin'; import { of } from './helpers'; diff --git a/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx b/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx index b5b6e54c304b7..b11bd167e15f2 100644 --- a/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx +++ b/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx @@ -32,7 +32,7 @@ import { } from '../lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; import { HelloWorldContainer } from '../lib/test_samples/embeddables/hello_world_container'; // eslint-disable-next-line -import { coreMock } from 'src/core/public/mocks'; +import { coreMock } from '../../../../core/public/mocks'; import { testPlugin } from './test_plugin'; import { EmbeddableApi } from '../api'; import { CustomizePanelModal } from '../lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal'; diff --git a/src/plugins/embeddable/public/tests/explicit_input.test.ts b/src/plugins/embeddable/public/tests/explicit_input.test.ts index 0a7f5e173f8b9..6cde7bdc48ba1 100644 --- a/src/plugins/embeddable/public/tests/explicit_input.test.ts +++ b/src/plugins/embeddable/public/tests/explicit_input.test.ts @@ -33,7 +33,7 @@ import { FilterableContainer } from '../lib/test_samples/embeddables/filterable_ import { isErrorEmbeddable } from '../lib'; import { HelloWorldContainer } from '../lib/test_samples/embeddables/hello_world_container'; // eslint-disable-next-line -import { coreMock } from 'src/core/public/mocks'; +import { coreMock } from '../../../../core/public/mocks'; const { setup, doStart, coreStart, uiActions } = testPlugin( coreMock.createSetup(), From ec25afcd8b17942b65fd300fd01749789773b481 Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 15:48:04 +0200 Subject: [PATCH 05/14] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .i18nrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.i18nrc.json b/.i18nrc.json index 818b0bf38afc2..4a43d0a87a036 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -13,7 +13,7 @@ "dashboardEmbeddableContainer": "src/legacy/core_plugins/dashboard_embeddable_container", "kbn": "src/legacy/core_plugins/kibana", "kbnDocViews": "src/legacy/core_plugins/kbn_doc_views", - "embeddableApi": "src/legacy/core_plugins/embeddable_api", + "embeddableApi": "src/plugins/embeddable", "kbnVislibVisTypes": "src/legacy/core_plugins/kbn_vislib_vis_types", "visTypeMarkdown": "src/legacy/core_plugins/vis_type_markdown", "visTypeMetric": "src/legacy/core_plugins/vis_type_metric", From ad2a926ac7668819259ad138f7af7a1bdf965e87 Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 16:13:42 +0200 Subject: [PATCH 06/14] =?UTF-8?q?test:=20=F0=9F=92=8D=20add=20Mocha=20mock?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/public/new_platform/new_platform.karma_mock.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/legacy/ui/public/new_platform/new_platform.karma_mock.js b/src/legacy/ui/public/new_platform/new_platform.karma_mock.js index b8a6a44f9624e..29868dc9767dc 100644 --- a/src/legacy/ui/public/new_platform/new_platform.karma_mock.js +++ b/src/legacy/ui/public/new_platform/new_platform.karma_mock.js @@ -24,6 +24,9 @@ export const npSetup = { chrome: {} }, plugins: { + embeddable: { + registerEmbeddableFactory: sinon.fake(), + }, expressions: { registerFunction: sinon.fake(), registerRenderer: sinon.fake(), @@ -52,6 +55,11 @@ export const npStart = { chrome: {} }, plugins: { + embeddable: { + getEmbeddableFactory: sinon.fake(), + getEmbeddableFactories: sinon.fake(), + registerEmbeddableFactory: sinon.fake(), + }, expressions: { registerFunction: sinon.fake(), registerRenderer: sinon.fake(), From a2bc38a30f8dd9d0dd58aa9cb9604a0af52941ba Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 16:55:07 +0200 Subject: [PATCH 07/14] =?UTF-8?q?fix:=20=F0=9F=90=9B=20change=20import=20s?= =?UTF-8?q?yntax=20from=20function=20test=20sample=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/np_ready/public/app/app.tsx | 5 ++++- .../np_ready/public/app/hello_world_container_example.tsx | 4 ++-- .../np_ready/public/app/hello_world_embeddable_example.tsx | 4 ++-- .../public/np_ready/public/embeddable_api.ts | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx index 63662293d3910..a5314fd706f2c 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx @@ -19,7 +19,10 @@ import { EuiTab } from '@elastic/eui'; import React, { Component } from 'react'; import { CoreStart } from 'src/core/public'; -import { GetEmbeddableFactory, GetEmbeddableFactories } from 'src/plugins/embeddable/public'; +import { + GetEmbeddableFactory, + GetEmbeddableFactories, +} from '../../../../../../../../src/plugins/embeddable/public'; import { TGetActionsCompatibleWithTrigger } from '../../../../../../../../src/plugins/ui_actions/public'; import { ContactCardEmbeddableExample } from './hello_world_embeddable_example'; import { HelloWorldContainerExample } from './hello_world_container_example'; diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_container_example.tsx b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_container_example.tsx index 3c0d42b0e13e7..efd700552ec32 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_container_example.tsx +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_container_example.tsx @@ -24,12 +24,12 @@ import { EmbeddablePanel, GetEmbeddableFactory, GetEmbeddableFactories, -} from 'src/plugins/embeddable/public'; +} from '../../../../../../../../src/plugins/embeddable/public'; import { HelloWorldContainer, CONTACT_CARD_EMBEDDABLE, HELLO_WORLD_EMBEDDABLE_TYPE, -} from 'src/plugins/embeddable/public/lib/test_samples'; +} from '../../../../../../../../src/plugins/embeddable/public/lib/test_samples'; import { TGetActionsCompatibleWithTrigger } from '../../../../../../../../src/plugins/ui_actions/public'; import { CoreStart } from '../../../../../../../../src/core/public'; import { Start as InspectorStartContract } from '../../../../../../../../src/plugins/inspector/public'; diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_embeddable_example.tsx b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_embeddable_example.tsx index 1cf734d2df947..78b122cb1baf5 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_embeddable_example.tsx +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/hello_world_embeddable_example.tsx @@ -22,8 +22,8 @@ import { EmbeddablePanel, GetEmbeddableFactory, GetEmbeddableFactories, -} from 'src/plugins/embeddable/public'; -import { HelloWorldEmbeddable } from 'src/plugins/embeddable/public/lib/test_samples'; +} from '../../../../../../../../src/plugins/embeddable/public'; +import { HelloWorldEmbeddable } from '../../../../../../../../src/plugins/embeddable/public/lib/test_samples'; import { TGetActionsCompatibleWithTrigger } from '../../../../../../../../src/plugins/ui_actions/public'; import { CoreStart } from '../../../../../../../../src/core/public'; import { Start as InspectorStartContract } from '../../../../../../../../src/plugins/inspector/public'; diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddable_api.ts b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddable_api.ts index 3d0dee4018e87..d4a8cbabc3c2a 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddable_api.ts +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/embeddable_api.ts @@ -17,5 +17,5 @@ * under the License. */ -export * from 'src/plugins/embeddable/public'; -export * from 'src/plugins/embeddable/public/lib/test_samples'; +export * from '../../../../../../../src/plugins/embeddable/public'; +export * from '../../../../../../../src/plugins/embeddable/public/lib/test_samples'; From 042e90be6714323015f7a3296114af3edf27cf4a Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 17:20:17 +0200 Subject: [PATCH 08/14] =?UTF-8?q?fix:=20=F0=9F=90=9B=20revert=20canvas=20c?= =?UTF-8?q?hanges=20back=20and=20leave=20placeholders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/np_ready/public/index.tsx | 20 ++++++++++++++++ .../public/np_ready/public/legacy.tsx | 24 +++++++++++++++++++ .../public/np_ready/public/mocks.tsx | 21 ++++++++++++++++ .../public/custom_time_range_action.test.ts | 4 ++-- .../test_helpers/time_range_embeddable.ts | 2 +- .../expression_types/embeddable.ts | 2 +- .../functions/common/saved_map.ts | 2 +- .../renderers/embeddable.tsx | 9 +++---- .../components/embeddable_flyout/flyout.tsx | 6 ++--- 9 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 src/legacy/core_plugins/embeddable_api/public/np_ready/public/index.tsx create mode 100644 src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.tsx create mode 100644 src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.tsx diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/index.tsx b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/index.tsx new file mode 100644 index 0000000000000..4b69616a777e9 --- /dev/null +++ b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/index.tsx @@ -0,0 +1,20 @@ +/* + * 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. + */ + +export * from '../../../../../../plugins/embeddable/public'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.tsx b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.tsx new file mode 100644 index 0000000000000..5357c2458e3b0 --- /dev/null +++ b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.tsx @@ -0,0 +1,24 @@ +/* + * 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. + */ + +// eslint-disable-next-line +import { npSetup, npStart } from 'ui/new_platform'; + +export const setup = npSetup.plugins.embeddable; +export const start = npStart.plugins.embeddable; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.tsx b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.tsx new file mode 100644 index 0000000000000..10510bff0c97e --- /dev/null +++ b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.tsx @@ -0,0 +1,21 @@ +/* + * 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. + */ + +// eslint-disable-next-line +export * from '../../../../../../plugins/embeddable/public/mocks'; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.test.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.test.ts index 4b9eb8dc5fc26..1a5b26134ff5a 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.test.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_action.test.ts @@ -10,7 +10,7 @@ import { skip } from 'rxjs/operators'; import * as Rx from 'rxjs'; import { mount } from 'enzyme'; -import { EmbeddableFactory } from 'src/plugins/embeddable/public'; +import { EmbeddableFactory } from '../../../../../../../src/plugins/embeddable/public'; import { TimeRangeEmbeddable, TimeRangeContainer, TIME_RANGE_EMBEDDABLE } from './test_helpers'; import { TimeRangeEmbeddableFactory } from './test_helpers/time_range_embeddable_factory'; import { CustomTimeRangeAction } from './custom_time_range_action'; @@ -21,7 +21,7 @@ import { HELLO_WORLD_EMBEDDABLE_TYPE, HelloWorldEmbeddable, HelloWorldContainer, -} from 'src/plugins/embeddable/public/lib/test_samples'; +} from '../../../../../../../src/plugins/embeddable/public/lib/test_samples'; /* eslint-enable */ import { nextTick } from 'test_utils/enzyme_helpers'; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable.ts index 103f7029c0ed3..0ca8a0ad9391f 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable.ts @@ -9,7 +9,7 @@ import { Embeddable, EmbeddableInput, IContainer, -} from 'src/plugins/embeddable/public'; +} from '../../../../../../../../src/plugins/embeddable/public'; import { TimeRange } from '../../../../../../../../src/plugins/data/public'; interface EmbeddableTimeRangeInput extends EmbeddableInput { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts index 21c97d88e3d98..cad46e81ffc0c 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts @@ -5,7 +5,7 @@ */ import { ExpressionType } from 'src/plugins/expressions/common'; -import { EmbeddableInput } from 'src/plugins/embeddable/public'; +import { EmbeddableInput } from 'src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { EmbeddableTypes } from './embeddable_types'; export const EmbeddableExpressionType = 'embeddable'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts index 01aaa426d1b35..c36a05e405704 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts @@ -6,7 +6,7 @@ import { Filter as ESFilterType } from '@kbn/es-query'; import { ExpressionFunction } from 'src/legacy/core_plugins/interpreter/public'; import { TimeRange } from 'src/plugins/data/public'; -import { EmbeddableInput } from 'src/plugins/embeddable/public'; +import { EmbeddableInput } from 'src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { buildEmbeddableFilters } from '../../../server/lib/build_embeddable_filters'; import { Filter } from '../../../types'; import { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable.tsx b/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable.tsx index 395a6d97daca6..8df365d661aef 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable.tsx +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable.tsx @@ -13,7 +13,8 @@ import { EmbeddablePanel, EmbeddableFactoryNotFoundError, EmbeddableInput, -} from '../../../../../../src/plugins/embeddable/public'; +} from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { start } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; import { EmbeddableExpression } from '../expression_types/embeddable'; import { SavedObjectFinder } from '../../../../../../src/legacy/ui/public/saved_objects/components/saved_object_finder'; @@ -39,8 +40,8 @@ const renderEmbeddable = (embeddableObject: IEmbeddable, domNode: HTMLElement) = ({ handlers: Handlers ) => { if (!embeddablesRegistry[input.id]) { - const factory = Array.from(npStart.plugins.embeddable.getEmbeddableFactories()).find( + const factory = Array.from(start.getEmbeddableFactories()).find( embeddableFactory => embeddableFactory.type === embeddableType ); diff --git a/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx b/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx index d09000dbcc280..0f03657e970bb 100644 --- a/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx +++ b/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx @@ -11,7 +11,7 @@ import { SavedObjectMetaData, } from 'ui/saved_objects/components/saved_object_finder'; import { EuiFlyout, EuiFlyoutHeader, EuiFlyoutBody, EuiTitle } from '@elastic/eui'; -import { npStart } from 'ui/new_platform'; +import { start } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; import { ComponentStrings } from '../../../i18n'; const { AddEmbeddableFlyout: strings } = ComponentStrings; @@ -24,7 +24,7 @@ export interface Props { export class AddEmbeddableFlyout extends React.Component { onAddPanel = (id: string, savedObjectType: string, name: string) => { - const embeddableFactories = npStart.plugins.embeddable.getEmbeddableFactories(); + const embeddableFactories = start.getEmbeddableFactories(); // Find the embeddable type from the saved object type const found = Array.from(embeddableFactories).find(embeddableFactory => { @@ -40,7 +40,7 @@ export class AddEmbeddableFlyout extends React.Component { }; render() { - const embeddableFactories = npStart.plugins.embeddable.getEmbeddableFactories(); + const embeddableFactories = start.getEmbeddableFactories(); const availableSavedObjects = Array.from(embeddableFactories) .filter(factory => { From e67de1d372004ba68c1b438878e6bcd9884c37fe Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 17:37:20 +0200 Subject: [PATCH 09/14] =?UTF-8?q?chore:=20=F0=9F=A4=96=20revert=20more=20c?= =?UTF-8?q?hanges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/np_ready/public/legacy.ts | 8 +++++-- .../lib/actions/expand_panel_action.test.tsx | 5 +++-- .../lib/actions/expand_panel_action.tsx | 2 +- .../embeddable/dashboard_container.test.tsx | 6 ++---- .../lib/embeddable/dashboard_container.tsx | 4 ++-- .../embeddable/grid/dashboard_grid.test.tsx | 3 +-- .../panel/create_panel_state.test.ts | 2 +- .../np_ready/public/lib/embeddable_api.ts | 2 +- .../public/tests/dashboard_container.test.tsx | 12 +++++------ .../np_ready/public/lib/test_samples/index.ts | 21 +++++++++++++++++++ .../embeddable/embeddable.tsx | 2 +- .../embeddable/embeddable_factory.ts | 2 +- .../public/editor_frame_plugin/plugin.tsx | 9 ++++---- .../maps/public/embeddable/map_embeddable.js | 2 +- .../embeddable/map_embeddable_factory.js | 6 +++--- .../panel_actions/get_csv_panel_action.tsx | 6 +++--- 16 files changed, 58 insertions(+), 34 deletions(-) create mode 100644 src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/index.ts diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/legacy.ts b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/legacy.ts index c0f44ad3adf08..ccb04d8c2e027 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/legacy.ts +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/legacy.ts @@ -24,16 +24,20 @@ import { ExitFullScreenButton } from 'ui/exit_full_screen'; /* eslint-enable @kbn/eslint/no-restricted-paths */ import { plugin } from '.'; +import { + setup as embeddableSetup, + start as embeddableStart, +} from '../../../../embeddable_api/public/np_ready/public/legacy'; const pluginInstance = plugin({} as any); export const setup = pluginInstance.setup(npSetup.core, { - embeddable: npSetup.plugins.embeddable, + embeddable: embeddableSetup, uiActions: npSetup.plugins.uiActions, }); export const start = pluginInstance.start(npStart.core, { - embeddable: npStart.plugins.embeddable, + embeddable: embeddableStart, inspector: npStart.plugins.inspector, __LEGACY: { SavedObjectFinder, diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx index 8a351494b6604..611b37dd7d54e 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx @@ -24,11 +24,12 @@ import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helper import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, +} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; +import { ContactCardEmbeddable, ContactCardEmbeddableInput, ContactCardEmbeddableOutput, - // eslint-disable-next-line @kbn/eslint/no-restricted-paths -} from 'src/plugins/embeddable/public/lib/test_samples'; +} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; import { DashboardOptions } from '../embeddable/dashboard_container_factory'; const embeddableFactories = new Map(); diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.tsx index 1e7d20bb63b18..f05d0b0efc2ee 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.tsx @@ -18,7 +18,7 @@ */ import { i18n } from '@kbn/i18n'; -import { IEmbeddable } from '../embeddable_api'; +import { IEmbeddable } from '../../../../../../embeddable_api/public/np_ready/public'; import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable'; import { IAction, diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx index 2fdf171b521be..8529f8944cbab 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx @@ -26,14 +26,12 @@ import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helper import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, - // eslint-disable-next-line -} from 'src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; +} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; import { ContactCardEmbeddableInput, ContactCardEmbeddable, ContactCardEmbeddableOutput, - // eslint-disable-next-line -} from 'src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; +} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; const options: DashboardContainerOptions = { application: {} as any, diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.tsx index 8be5f7c42daf4..919995f544960 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.tsx @@ -30,8 +30,7 @@ import { ViewMode, EmbeddableFactory, IEmbeddable, - Start as EmbeddableStartContract, -} from '../embeddable_api'; +} from '../../../../../../embeddable_api/public/np_ready/public'; import { DASHBOARD_CONTAINER_TYPE } from './dashboard_container_factory'; import { createPanelState } from './panel'; import { DashboardPanelState } from './types'; @@ -39,6 +38,7 @@ import { DashboardViewport } from './viewport/dashboard_viewport'; import { Query } from '../../../../../../data/public'; import { CoreStart } from '../../../../../../../../core/public'; import { Start as InspectorStartContract } from '../../../../../../../../plugins/inspector/public'; +import { Start as EmbeddableStartContract } from '../../../../../../embeddable_api/public/np_ready/public'; import { KibanaReactContext, KibanaReactContextValue, diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/grid/dashboard_grid.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/grid/dashboard_grid.test.tsx index 8dff4d7a7c826..386aae9ddcf78 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/grid/dashboard_grid.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/grid/dashboard_grid.test.tsx @@ -30,8 +30,7 @@ import { getSampleDashboardInput } from '../../test_helpers'; import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, - // eslint-disable-next-line @kbn/eslint/no-restricted-paths -} from 'src/plugins/embeddable/public/lib/test_samples'; +} from '../../../../../../../embeddable_api/public/np_ready/public/lib/test_samples'; import { KibanaContextProvider } from '../../../../../../../../../plugins/kibana_react/public'; let dashboardContainer: DashboardContainer | undefined; diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/panel/create_panel_state.test.ts b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/panel/create_panel_state.test.ts index 3ca791f23a087..e66a25831577c 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/panel/create_panel_state.test.ts +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/panel/create_panel_state.test.ts @@ -22,7 +22,7 @@ import { DashboardPanelState } from '../types'; import { createPanelState } from './create_panel_state'; import { EmbeddableInput } from '../../embeddable_api'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { CONTACT_CARD_EMBEDDABLE } from 'src/plugins/embeddable/public/lib/test_samples'; +import { CONTACT_CARD_EMBEDDABLE } from '../../../../../../../embeddable_api/public/np_ready/public/lib/test_samples'; interface TestInput extends EmbeddableInput { test: string; diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts index 9f9fd47ad1ebf..17911b908d3b3 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable_api.ts @@ -17,4 +17,4 @@ * under the License. */ -export * from '../../../../../../../../src/plugins/embeddable/public'; +export * from '../../../../../embeddable_api/public/np_ready/public'; diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx index f091ed973a9c2..e9b84eca594ae 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx @@ -31,15 +31,15 @@ import { import { getSampleDashboardInput } from '../lib/test_helpers'; import { CONTACT_CARD_EMBEDDABLE, + ContactCardEmbeddableFactory, +} from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; +import { ContactCardEmbeddableInput, ContactCardEmbeddable, ContactCardEmbeddableOutput, - createEditModeAction, - ContactCardEmbeddableFactory, - // eslint-disable-next-line @kbn/eslint/no-restricted-paths -} from 'src/plugins/embeddable/public/lib/test_samples'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; +} from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; +import { embeddablePluginMock } from '../../../../../embeddable_api/public/np_ready/public/mocks'; +import { createEditModeAction } from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples/actions/edit_mode_action'; // eslint-disable-next-line import { inspectorPluginMock } from '../../../../../../../plugins/inspector/public/mocks'; import { KibanaContextProvider } from '../../../../../../../plugins/kibana_react/public'; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/index.ts b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/index.ts new file mode 100644 index 0000000000000..4f0537aff5dc2 --- /dev/null +++ b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/test_samples/index.ts @@ -0,0 +1,21 @@ +/* + * 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. + */ + +// eslint-disable-next-line +export * from '../../../../../../../../plugins/embeddable/public/lib/test_samples'; diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable.tsx b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable.tsx index 5b4accb3bf401..e815a1951bdb7 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable.tsx +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable.tsx @@ -18,7 +18,7 @@ import { EmbeddableOutput, IContainer, EmbeddableInput, -} from '../../../../../../../src/plugins/embeddable/public'; +} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { Document, DOC_TYPE } from '../../persistence'; import { ExpressionWrapper } from './expression_wrapper'; diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable_factory.ts b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable_factory.ts index fee69de844ef6..c340342a31ff6 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable_factory.ts +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/embeddable_factory.ts @@ -16,7 +16,7 @@ import { ErrorEmbeddable, EmbeddableInput, IContainer, -} from '../../../../../../../src/plugins/embeddable/public'; +} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { Embeddable } from './embeddable'; import { SavedObjectIndexStore, DOC_TYPE } from '../../persistence'; import { getEditPath } from '../../../common'; diff --git a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/plugin.tsx b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/plugin.tsx index 4e6ce2cf3fc8a..e27c2e54500cf 100644 --- a/x-pack/legacy/plugins/lens/public/editor_frame_plugin/plugin.tsx +++ b/x-pack/legacy/plugins/lens/public/editor_frame_plugin/plugin.tsx @@ -10,7 +10,8 @@ import { I18nProvider } from '@kbn/i18n/react'; import { CoreSetup, CoreStart } from 'src/core/public'; import chrome, { Chrome } from 'ui/chrome'; import { npSetup, npStart } from 'ui/new_platform'; -import { Plugin as EmbeddablePlugin } from '../../../../../../src/plugins/embeddable/public'; +import { Plugin as EmbeddablePlugin } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { start as embeddablePlugin } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; import { setup as dataSetup, start as dataStart, @@ -39,7 +40,7 @@ export interface EditorFrameSetupPlugins { export interface EditorFrameStartPlugins { data: typeof dataStart; expressions: typeof expressionsStart; - embeddable: ReturnType; + embeddables: ReturnType; chrome: Chrome; } @@ -63,7 +64,7 @@ export class EditorFramePlugin { } public start(core: CoreStart, plugins: EditorFrameStartPlugins): EditorFrameStart { - plugins.embeddable.registerEmbeddableFactory( + plugins.embeddables.registerEmbeddableFactory( 'lens', new EmbeddableFactory( plugins.chrome, @@ -133,7 +134,7 @@ export const editorFrameStart = () => data: dataStart, expressions: expressionsStart, chrome, - embeddable: npStart.plugins.embeddable, + embeddables: embeddablePlugin, }); export const editorFrameStop = () => editorFrame.stop(); diff --git a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.js b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.js index dd46c8954178c..cccd169436efc 100644 --- a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.js +++ b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable.js @@ -10,7 +10,7 @@ import { Provider } from 'react-redux'; import { render, unmountComponentAtNode } from 'react-dom'; import 'mapbox-gl/dist/mapbox-gl.css'; -import { Embeddable, APPLY_FILTER_TRIGGER } from '../../../../../../src/plugins/embeddable/public'; +import { Embeddable, APPLY_FILTER_TRIGGER } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { onlyDisabledFiltersChanged } from '../../../../../../src/legacy/core_plugins/data/public'; import { I18nContext } from 'ui/i18n'; diff --git a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js index f7ca1e1d448a4..5fe1094b75e5c 100644 --- a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js +++ b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js @@ -6,13 +6,13 @@ import _ from 'lodash'; import chrome from 'ui/chrome'; -import { npSetup } from 'ui/new_platform'; import { capabilities } from 'ui/capabilities'; import { i18n } from '@kbn/i18n'; import { EmbeddableFactory, ErrorEmbeddable -} from '../../../../../../src/plugins/embeddable/public'; +} from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +import { setup } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; import { MapEmbeddable } from './map_embeddable'; import { indexPatternService } from '../kibana_services'; @@ -145,4 +145,4 @@ export class MapEmbeddableFactory extends EmbeddableFactory { } } -npSetup.plugins.embeddable.registerEmbeddableFactory(MAP_SAVED_OBJECT_TYPE, new MapEmbeddableFactory()); +setup.registerEmbeddableFactory(MAP_SAVED_OBJECT_TYPE, new MapEmbeddableFactory()); diff --git a/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx b/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx index 2b4241caaa051..fd33bc79eeaf8 100644 --- a/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx +++ b/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx @@ -12,13 +12,13 @@ import { toastNotifications } from 'ui/notify'; import chrome from 'ui/chrome'; import { npSetup } from 'ui/new_platform'; +import { IAction, IncompatibleActionError } from '../../../../../../src/plugins/ui_actions/public'; + import { ViewMode, IEmbeddable, CONTEXT_MENU_TRIGGER, -} from '../../../../../../src/plugins/embeddable/public'; -import { IAction, IncompatibleActionError } from '../../../../../../src/plugins/ui_actions/public'; - +} from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { ISearchEmbeddable, SEARCH_EMBEDDABLE_TYPE, From b9479d7815233a60363f108db6a7ce859f77e6d6 Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 18:30:06 +0200 Subject: [PATCH 10/14] =?UTF-8?q?chore:=20=F0=9F=A4=96=20revert=20more=20c?= =?UTF-8?q?hanges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../viewport/dashboard_viewport.test.tsx | 3 +-- .../np_ready/public/{index.tsx => index.ts} | 0 .../np_ready/public/{legacy.tsx => legacy.ts} | 0 .../np_ready/public/{mocks.tsx => mocks.ts} | 0 .../kibana/public/dashboard/dashboard_app.tsx | 2 +- .../dashboard/dashboard_app_controller.tsx | 19 ++++++++++--------- ...embeddable_saved_object_converters.test.ts | 2 +- .../discover/embeddable/search_embeddable.ts | 6 +++--- .../public/np_ready/public/app/app.tsx | 2 +- .../actions/apply_siem_filter_action.test.tsx | 6 +++++- .../actions/apply_siem_filter_action.tsx | 2 +- .../components/embeddables/embedded_map.tsx | 7 ++++--- .../embeddables/embedded_map_helpers.tsx | 11 ++++++----- .../public/components/embeddables/types.ts | 6 +++++- 14 files changed, 38 insertions(+), 28 deletions(-) rename src/legacy/core_plugins/embeddable_api/public/np_ready/public/{index.tsx => index.ts} (100%) rename src/legacy/core_plugins/embeddable_api/public/np_ready/public/{legacy.tsx => legacy.ts} (100%) rename src/legacy/core_plugins/embeddable_api/public/np_ready/public/{mocks.tsx => mocks.ts} (100%) diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/viewport/dashboard_viewport.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/viewport/dashboard_viewport.test.tsx index 6da7dcb90cbc7..01bde21f91d3b 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/viewport/dashboard_viewport.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/viewport/dashboard_viewport.test.tsx @@ -31,8 +31,7 @@ import { getSampleDashboardInput } from '../../test_helpers'; import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, - // eslint-disable-next-line -} from 'src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; +} from '../../../../../../../embeddable_api/public/np_ready/public/lib/test_samples'; import { KibanaContextProvider } from '../../../../../../../../../plugins/kibana_react/public'; let dashboardContainer: DashboardContainer | undefined; diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/index.tsx b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/index.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/index.tsx rename to src/legacy/core_plugins/embeddable_api/public/np_ready/public/index.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.tsx b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.tsx rename to src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy.ts diff --git a/src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.tsx b/src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.ts similarity index 100% rename from src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.tsx rename to src/legacy/core_plugins/embeddable_api/public/np_ready/public/mocks.ts diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx index b2bcd62e11b5a..1f65ccebb67d9 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx @@ -43,7 +43,7 @@ import { StaticIndexPattern, Query, SavedQuery } from 'plugins/data'; import moment from 'moment'; import { Subscription } from 'rxjs'; -import { ViewMode } from 'src/plugins/embeddable/public'; +import { ViewMode } from '../../../embeddable_api/public/np_ready/public'; import { SavedObjectDashboard } from './saved_dashboard/saved_dashboard'; import { DashboardAppState, SavedDashboardPanel, ConfirmModalFn } from './types'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx index 7095c8d790cdc..741931af11c7d 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx @@ -57,12 +57,6 @@ import { capabilities } from 'ui/capabilities'; import { Subscription } from 'rxjs'; import { npStart } from 'ui/new_platform'; import { SavedObjectFinder } from 'ui/saved_objects/components/saved_object_finder'; -import { - isErrorEmbeddable, - ErrorEmbeddable, - ViewMode, - openAddPanelFlyout, -} from '../../../../../../src/plugins/embeddable/public'; import { data } from '../../../data/public/setup'; import { @@ -72,6 +66,13 @@ import { DashboardContainerInput, DashboardPanelState, } from '../../../dashboard_embeddable_container/public/np_ready/public'; +import { + isErrorEmbeddable, + ErrorEmbeddable, + ViewMode, + openAddPanelFlyout, +} from '../../../embeddable_api/public/np_ready/public'; +import { start } from '../../../embeddable_api/public/np_ready/public/legacy'; import { DashboardAppState, NavAction, ConfirmModalFn, SavedDashboardPanel } from './types'; import { showOptionsPopover } from './top_nav/show_options_popover'; @@ -241,7 +242,7 @@ export class DashboardAppController { let outputSubscription: Subscription | undefined; const dashboardDom = document.getElementById('dashboardViewport'); - const dashboardFactory = npStart.plugins.embeddable.getEmbeddableFactory( + const dashboardFactory = start.getEmbeddableFactory( DASHBOARD_CONTAINER_TYPE ) as DashboardContainerFactory; dashboardFactory @@ -744,8 +745,8 @@ export class DashboardAppController { if (dashboardContainer && !isErrorEmbeddable(dashboardContainer)) { openAddPanelFlyout({ embeddable: dashboardContainer, - getAllFactories: npStart.plugins.embeddable.getEmbeddableFactories, - getFactory: npStart.plugins.embeddable.getEmbeddableFactory, + getAllFactories: start.getEmbeddableFactories, + getFactory: start.getEmbeddableFactory, notifications: npStart.core.notifications, overlays: npStart.core.overlays, SavedObjectFinder, diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.test.ts b/src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.test.ts index f6a7428959587..99bb6b115b985 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.test.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.test.ts @@ -24,7 +24,7 @@ import { } from './embeddable_saved_object_converters'; import { SavedDashboardPanel } from '../types'; import { DashboardPanelState } from 'src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public'; -import { EmbeddableInput } from 'src/plugins/embeddable/public'; +import { EmbeddableInput } from 'src/legacy/core_plugins/embeddable_api/public/np_ready/public'; interface CustomInput extends EmbeddableInput { something: string; diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts index c180efc8df093..d5bf868f3bf72 100644 --- a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts +++ b/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts @@ -37,13 +37,13 @@ import { i18n } from '@kbn/i18n'; import { toastNotifications } from 'ui/notify'; import { TimeRange } from 'src/plugins/data/public'; import { TExecuteTriggerActions } from 'src/plugins/ui_actions/public'; +import { setup as data } from '../../../../data/public/legacy'; +import { Query, onlyDisabledFiltersChanged, getTime } from '../../../../data/public'; import { APPLY_FILTER_TRIGGER, Embeddable, Container, -} from '../../../../../../plugins/embeddable/public'; -import { setup as data } from '../../../../data/public/legacy'; -import { Query, onlyDisabledFiltersChanged, getTime } from '../../../../data/public'; +} from '../../../../embeddable_api/public/np_ready/public'; import * as columnActions from '../doc_table/actions/columns'; import { SavedSearch } from '../types'; import searchTemplate from './search_template.html'; diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx index a5314fd706f2c..c0ed2b027f0e4 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/app.tsx @@ -22,7 +22,7 @@ import { CoreStart } from 'src/core/public'; import { GetEmbeddableFactory, GetEmbeddableFactories, -} from '../../../../../../../../src/plugins/embeddable/public'; +} from 'src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { TGetActionsCompatibleWithTrigger } from '../../../../../../../../src/plugins/ui_actions/public'; import { ContactCardEmbeddableExample } from './hello_world_embeddable_example'; import { HelloWorldContainerExample } from './hello_world_container_example'; diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx index 95861118e759e..bdbfad15a9810 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx @@ -14,7 +14,11 @@ import { } from './apply_siem_filter_action'; // @ts-ignore Missing type defs as maps moves to Typescript import { MAP_SAVED_OBJECT_TYPE } from '../../../../../maps/common/constants'; -import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from 'src/plugins/embeddable/public'; +import { + EmbeddableInput, + EmbeddableOutput, + IEmbeddable, +} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables'; import { Filter } from '@kbn/es-query'; // Using type narrowing to remove all the any's -- https://github.com/elastic/kibana/pull/43965/files#r318796100 diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx index 0dac950656429..53292426c6575 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx @@ -8,7 +8,7 @@ import { Filter } from '@kbn/es-query'; import { getOr } from 'lodash/fp'; import { i18n } from '@kbn/i18n'; import { IAction } from 'src/plugins/ui_actions/public'; -import { IEmbeddable } from 'src/plugins/embeddable/public'; +import { IEmbeddable } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables'; // @ts-ignore Missing type defs as maps moves to Typescript import { MAP_SAVED_OBJECT_TYPE } from '../../../../../maps/common/constants'; diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx index 42254e37097d0..86696503dbda3 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx @@ -10,7 +10,8 @@ import { npStart } from 'ui/new_platform'; import { SavedObjectFinder } from 'ui/saved_objects/components/saved_object_finder'; import styled from 'styled-components'; -import { EmbeddablePanel } from '../../../../../../../src/plugins/embeddable/public'; +import { start } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; +import { EmbeddablePanel } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { Loader } from '../loader'; import { useIndexPatterns } from '../ml_popover/hooks/use_index_patterns'; @@ -134,8 +135,8 @@ export const EmbeddedMap = React.memo( data-test-subj="embeddable-panel" embeddable={embeddable} getActions={npStart.plugins.uiActions.getTriggerCompatibleActions} - getEmbeddableFactory={npStart.plugins.embeddable.getEmbeddableFactory} - getAllEmbeddableFactories={npStart.plugins.embeddable.getEmbeddableFactories} + getEmbeddableFactory={start.getEmbeddableFactory} + getAllEmbeddableFactories={start.getEmbeddableFactories} notifications={npStart.core.notifications} overlays={npStart.core.overlays} inspector={npStart.plugins.inspector} diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx index f5df4be879c90..1ecb478ebe244 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx @@ -6,14 +6,15 @@ import uuid from 'uuid'; import { npStart } from 'ui/new_platform'; +import { ActionToaster, AppToast } from '../toasters'; +import { start } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; import { - ViewMode, - APPLY_FILTER_ACTION, APPLY_FILTER_TRIGGER, CONTEXT_MENU_TRIGGER, PANEL_BADGE_TRIGGER, -} from '../../../../../../../src/plugins/embeddable/public'; -import { ActionToaster, AppToast } from '../toasters'; + APPLY_FILTER_ACTION, + ViewMode, +} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { APPLY_SIEM_FILTER_ACTION_ID, ApplySiemFilterAction, @@ -97,7 +98,7 @@ export const createEmbeddable = async ( endDate: number, setQuery: SetQuery ): Promise => { - const factory = npStart.plugins.embeddable.getEmbeddableFactory(MAP_SAVED_OBJECT_TYPE); + const factory = start.getEmbeddableFactory(MAP_SAVED_OBJECT_TYPE); const state = { layerList: getLayerList(indexPatterns), diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/types.ts b/x-pack/legacy/plugins/siem/public/components/embeddables/types.ts index 1f4d53b26a6f4..2f401ba841a93 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/types.ts +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/types.ts @@ -6,7 +6,11 @@ import { Filter as ESFilterType } from '@kbn/es-query'; import { TimeRange } from 'src/plugins/data/public'; -import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from 'src/plugins/embeddable/public'; +import { + EmbeddableInput, + EmbeddableOutput, + IEmbeddable, +} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { inputsModel } from '../../store/inputs'; export interface MapEmbeddableInput extends EmbeddableInput { From 7cc0e83b2863ca1625858b066753129579326980 Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 18:38:21 +0200 Subject: [PATCH 11/14] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20TypeScript=20?= =?UTF-8?q?type=20check=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/lib/actions/expand_panel_action.test.tsx | 4 +--- .../public/lib/embeddable/dashboard_container.test.tsx | 4 +--- .../np_ready/public/tests/dashboard_container.test.tsx | 6 +++--- .../embeddables/actions/apply_siem_filter_action.test.tsx | 2 +- .../embeddables/actions/apply_siem_filter_action.tsx | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx index 611b37dd7d54e..0fa34817bee86 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/actions/expand_panel_action.test.tsx @@ -24,12 +24,10 @@ import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helper import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, -} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; -import { ContactCardEmbeddable, ContactCardEmbeddableInput, ContactCardEmbeddableOutput, -} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; +} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples'; import { DashboardOptions } from '../embeddable/dashboard_container_factory'; const embeddableFactories = new Map(); diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx index 8529f8944cbab..06bc696b95193 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/lib/embeddable/dashboard_container.test.tsx @@ -26,12 +26,10 @@ import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helper import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, -} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; -import { ContactCardEmbeddableInput, ContactCardEmbeddable, ContactCardEmbeddableOutput, -} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; +} from '../../../../../../embeddable_api/public/np_ready/public/lib/test_samples'; const options: DashboardContainerOptions = { application: {} as any, diff --git a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx index e9b84eca594ae..6cf409581b76d 100644 --- a/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx +++ b/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/tests/dashboard_container.test.tsx @@ -32,14 +32,14 @@ import { getSampleDashboardInput } from '../lib/test_helpers'; import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, -} from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; +} from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples'; import { ContactCardEmbeddableInput, ContactCardEmbeddable, ContactCardEmbeddableOutput, -} from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable'; +} from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples'; import { embeddablePluginMock } from '../../../../../embeddable_api/public/np_ready/public/mocks'; -import { createEditModeAction } from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples/actions/edit_mode_action'; +import { createEditModeAction } from '../../../../../embeddable_api/public/np_ready/public/lib/test_samples'; // eslint-disable-next-line import { inspectorPluginMock } from '../../../../../../../plugins/inspector/public/mocks'; import { KibanaContextProvider } from '../../../../../../../plugins/kibana_react/public'; diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx index bdbfad15a9810..66636766f9872 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.test.tsx @@ -18,7 +18,7 @@ import { EmbeddableInput, EmbeddableOutput, IEmbeddable, -} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables'; +} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; import { Filter } from '@kbn/es-query'; // Using type narrowing to remove all the any's -- https://github.com/elastic/kibana/pull/43965/files#r318796100 diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx index 53292426c6575..8ee016f12deed 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/actions/apply_siem_filter_action.tsx @@ -8,7 +8,7 @@ import { Filter } from '@kbn/es-query'; import { getOr } from 'lodash/fp'; import { i18n } from '@kbn/i18n'; import { IAction } from 'src/plugins/ui_actions/public'; -import { IEmbeddable } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/lib/embeddables'; +import { IEmbeddable } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; // @ts-ignore Missing type defs as maps moves to Typescript import { MAP_SAVED_OBJECT_TYPE } from '../../../../../maps/common/constants'; From d6123a9c98f7fd7f453f4502dd08f7ea2c4e8b39 Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 19:16:22 +0200 Subject: [PATCH 12/14] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20functional=20?= =?UTF-8?q?test=20imports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/lib/test_samples/actions/edit_mode_action.ts | 2 +- .../public/lib/test_samples/actions/say_hello_action.tsx | 2 +- .../public/lib/test_samples/actions/send_message_action.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts b/src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts index a3bbca2715402..feecc8e262ee9 100644 --- a/src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts +++ b/src/plugins/embeddable/public/lib/test_samples/actions/edit_mode_action.ts @@ -17,7 +17,7 @@ * under the License. */ -import { createAction } from 'src/plugins/ui_actions/public'; +import { createAction } from '../../ui_actions'; import { ViewMode } from '../../types'; import { IEmbeddable } from '../../embeddables'; diff --git a/src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx b/src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx index 899de07ffce7c..5b61a3a71a641 100644 --- a/src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/actions/say_hello_action.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { IAction, IncompatibleActionError } from 'src/plugins/ui_actions/public'; +import { IAction, IncompatibleActionError } from '../../ui_actions'; import { EmbeddableInput, Embeddable, EmbeddableOutput, IEmbeddable } from '../../embeddables'; export const SAY_HELLO_ACTION = 'SAY_HELLO_ACTION'; diff --git a/src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx b/src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx index b5396830a6c0d..fc20a99987484 100644 --- a/src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/actions/send_message_action.tsx @@ -18,8 +18,8 @@ */ import React from 'react'; import { EuiFlyoutBody } from '@elastic/eui'; -import { createAction, IncompatibleActionError } from 'src/plugins/ui_actions/public'; -import { CoreStart } from 'src/core/public'; +import { createAction, IncompatibleActionError } from '../../ui_actions'; +import { CoreStart } from '../../../../../../core/public'; import { Embeddable, EmbeddableInput } from '../../embeddables'; import { GetMessageModal } from './get_message_modal'; import { FullNameEmbeddableOutput, hasFullNameOutput } from './say_hello_action'; From bfbd9d919c62525db2673dca85430516be33dac4 Mon Sep 17 00:00:00 2001 From: streamich Date: Thu, 26 Sep 2019 19:21:23 +0200 Subject: [PATCH 13/14] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20x-pack=20Jest?= =?UTF-8?q?=20test=20importa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/np_ready/public/can_inherit_time_range.test.ts | 2 +- .../public/np_ready/public/custom_time_range_badge.test.ts | 2 +- .../public/np_ready/public/test_helpers/time_range_container.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.test.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.test.ts index 9d5d3be101244..a0a550da1d24c 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.test.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/can_inherit_time_range.test.ts @@ -8,7 +8,7 @@ import { canInheritTimeRange } from './can_inherit_time_range'; import { HelloWorldEmbeddable, HelloWorldContainer, -} from 'src/plugins/embeddable/public/lib/test_samples'; +} from '../../../../../../../src/plugins/embeddable/public/lib/test_samples'; /** eslint-enable */ import { TimeRangeEmbeddable, TimeRangeContainer } from './test_helpers'; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.test.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.test.ts index 925a3fbfcfeca..9b13e5b03cf10 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.test.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/custom_time_range_badge.test.ts @@ -10,7 +10,7 @@ import { skip } from 'rxjs/operators'; import * as Rx from 'rxjs'; import { mount } from 'enzyme'; -import { EmbeddableFactory } from 'src/plugins/embeddable/public'; +import { EmbeddableFactory } from '../../../../../../../src/plugins/embeddable/public'; import { TimeRangeEmbeddable, TimeRangeContainer, TIME_RANGE_EMBEDDABLE } from './test_helpers'; import { TimeRangeEmbeddableFactory } from './test_helpers/time_range_embeddable_factory'; import { CustomTimeRangeBadge } from './custom_time_range_badge'; diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_container.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_container.ts index bda819f8658d4..a916f40160c59 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_container.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_container.ts @@ -9,7 +9,7 @@ import { Container, ContainerOutput, GetEmbeddableFactory, -} from 'src/plugins/embeddable/public'; +} from '../../../../../../../../src/plugins/embeddable/public'; import { TimeRange } from '../../../../../../../../src/plugins/data/public'; /** From 0befc40f25d8acdc3738ed59cb72558297e5cddb Mon Sep 17 00:00:00 2001 From: streamich Date: Fri, 27 Sep 2019 12:34:22 +0200 Subject: [PATCH 14/14] =?UTF-8?q?test:=20=F0=9F=92=8D=20fix=20advanced=5Fu?= =?UTF-8?q?i=5Factiosn=20import=20for=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/test_helpers/time_range_embeddable_factory.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable_factory.ts b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable_factory.ts index e91f907e6fce0..225bf3420faa1 100644 --- a/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable_factory.ts +++ b/x-pack/legacy/plugins/advanced_ui_actions/public/np_ready/public/test_helpers/time_range_embeddable_factory.ts @@ -4,7 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EmbeddableInput, IContainer, EmbeddableFactory } from 'src/plugins/embeddable/public'; +import { + EmbeddableInput, + IContainer, + EmbeddableFactory, +} from '../../../../../../../../src/plugins/embeddable/public'; import { TimeRange } from '../../../../../../../../src/plugins/data/public'; import { TIME_RANGE_EMBEDDABLE, TimeRangeEmbeddable } from './time_range_embeddable';