From 6f3d94a00a4661770f0c80a1ea6e959a914f06f2 Mon Sep 17 00:00:00 2001 From: Corey Robertson Date: Tue, 5 May 2020 10:26:52 -0400 Subject: [PATCH] Correct paths --- .../__tests__/fixtures/function_specs.ts | 2 +- .../expression_types/embeddable.ts | 4 +- .../expression_types/embeddable_types.ts | 9 ++-- .../common/plot/get_flot_axis_config.ts | 2 +- .../functions/common/saved_map.ts | 2 +- .../functions/server/escount.ts | 2 +- .../functions/server/esdocs.ts | 2 +- .../functions/server/essql.ts | 2 +- .../canvas/canvas_plugin_src/plugin.ts | 6 +-- .../renderers/embeddable/embeddable.tsx | 6 +-- .../input_type_to_expression/map.test.ts | 2 +- .../input_type_to_expression/map.ts | 2 +- .../renderers/markdown/index.js | 2 +- .../plugins/canvas/common/lib/autocomplete.ts | 2 +- x-pack/plugins/canvas/common/lib/fonts.ts | 2 +- .../lib/get_id.ts} | 11 ++-- .../i18n/elements/element_strings.test.ts | 2 +- x-pack/plugins/canvas/public/application.tsx | 6 +-- .../public/components/asset_manager/index.ts | 2 +- .../components/element_content/index.js | 2 +- .../components/embeddable_flyout/flyout.tsx | 4 +- .../components/embeddable_flyout/index.tsx | 2 +- .../public/components/expression/index.js | 2 +- .../expression_input/expression_input.tsx | 4 +- .../components/expression_input/reference.ts | 2 +- .../public/components/render_with_fn/index.js | 2 +- .../components/saved_elements_modal/index.ts | 2 +- .../workpad_header/element_menu/index.tsx | 2 +- .../workpad_header/share_menu/flyout/index.ts | 2 +- .../workpad_header/share_menu/index.ts | 4 +- .../workpad_header/share_menu/utils.ts | 2 +- .../workpad_header/view_menu/index.ts | 2 +- .../public/components/workpad_loader/index.js | 2 +- .../components/workpad_templates/index.js | 2 +- .../canvas/public/feature_catalogue_entry.ts | 2 +- x-pack/plugins/canvas/public/index.ts | 12 ++++- x-pack/plugins/canvas/public/legacy.ts | 53 ------------------- .../canvas/public/legacy_plugin_support.ts | 47 ---------------- .../public/legacy_register_interpreter.ts | 18 ------- x-pack/plugins/canvas/public/legacy_start.ts | 27 ---------- .../plugins/canvas/public/lib/breadcrumbs.ts | 2 +- .../public/lib/build_embeddable_filters.ts | 6 +-- .../canvas/public/lib/clipboard.test.ts | 4 +- x-pack/plugins/canvas/public/lib/clipboard.ts | 2 +- x-pack/plugins/canvas/public/plugin.tsx | 22 +++----- x-pack/plugins/canvas/public/plugin_api.ts | 2 +- .../plugins/canvas/public/services/index.ts | 2 +- .../plugins/canvas/public/services/notify.ts | 4 +- .../canvas/public/state/selectors/workpad.ts | 4 +- x-pack/plugins/canvas/public/store.ts | 2 +- .../canvas/server/collectors/collector.ts | 2 +- .../collectors/workpad_collector.test.ts | 2 +- .../server/collectors/workpad_collector.ts | 2 +- .../routes/custom_elements/create.test.ts | 2 +- .../server/routes/custom_elements/create.ts | 7 +-- .../custom_element_attributes.ts | 2 +- .../routes/custom_elements/delete.test.ts | 2 +- .../server/routes/custom_elements/delete.ts | 5 +- .../server/routes/custom_elements/find.ts | 5 +- .../server/routes/custom_elements/get.test.ts | 2 +- .../server/routes/custom_elements/get.ts | 5 +- .../routes/custom_elements/update.test.ts | 4 +- .../server/routes/custom_elements/update.ts | 5 +- .../server/routes/es_fields/es_fields.ts | 2 +- .../server/routes/shareables/download.ts | 4 +- .../server/routes/shareables/zip.test.ts | 4 +- .../canvas/server/routes/shareables/zip.ts | 4 +- .../server/routes/workpad/create.test.ts | 2 +- .../canvas/server/routes/workpad/create.ts | 9 ++-- .../server/routes/workpad/delete.test.ts | 2 +- .../canvas/server/routes/workpad/delete.ts | 5 +- .../canvas/server/routes/workpad/find.ts | 5 +- .../canvas/server/routes/workpad/get.test.ts | 6 +-- .../canvas/server/routes/workpad/get.ts | 5 +- .../server/routes/workpad/update.test.ts | 4 +- .../canvas/server/routes/workpad/update.ts | 2 +- .../routes/workpad/workpad_attributes.ts | 2 +- .../server/saved_objects/custom_element.ts | 2 +- .../canvas/server/saved_objects/workpad.ts | 2 +- .../canvas/server/setup_interpreter.ts | 2 +- x-pack/plugins/canvas/types/index.ts | 2 +- 81 files changed, 122 insertions(+), 300 deletions(-) rename x-pack/plugins/canvas/{public/legacy_register_feature.ts => common/lib/get_id.ts} (53%) delete mode 100644 x-pack/plugins/canvas/public/legacy.ts delete mode 100644 x-pack/plugins/canvas/public/legacy_plugin_support.ts delete mode 100644 x-pack/plugins/canvas/public/legacy_register_interpreter.ts delete mode 100644 x-pack/plugins/canvas/public/legacy_start.ts diff --git a/x-pack/plugins/canvas/__tests__/fixtures/function_specs.ts b/x-pack/plugins/canvas/__tests__/fixtures/function_specs.ts index 3ed08268222d0f..edf11f5a25c080 100644 --- a/x-pack/plugins/canvas/__tests__/fixtures/function_specs.ts +++ b/x-pack/plugins/canvas/__tests__/fixtures/function_specs.ts @@ -5,6 +5,6 @@ */ import { functions as browserFns } from '../../canvas_plugin_src/functions/browser'; -import { ExpressionFunction } from '../../../../../../src/plugins/expressions'; +import { ExpressionFunction } from '../../../../../src/plugins/expressions'; export const functionSpecs = browserFns.map(fn => new ExpressionFunction(fn())); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts index fbe7825c3b2c87..74de223b9fcb7a 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ExpressionTypeDefinition } from '../../../../../../src/plugins/expressions'; -import { EmbeddableInput } from '../../../../../../src/plugins/embeddable/public'; +import { ExpressionTypeDefinition } from '../../../../../src/plugins/expressions'; +import { EmbeddableInput } from '../../../../../src/plugins/embeddable/public'; import { EmbeddableTypes } from './embeddable_types'; export const EmbeddableExpressionType = 'embeddable'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts index 592da1ff039a15..85629936d9ad36 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts @@ -3,11 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ - -import { MAP_SAVED_OBJECT_TYPE } from '../../../../../plugins/maps/public'; -import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../../src/plugins/visualizations/public'; -import { LENS_EMBEDDABLE_TYPE } from '../../../../../plugins/lens/common/constants'; -import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../../src/plugins/discover/public'; +import { MAP_SAVED_OBJECT_TYPE } from '../../../../plugins/maps/public'; +import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../src/plugins/visualizations/public'; +import { LENS_EMBEDDABLE_TYPE } from '../../../../plugins/lens/common/constants'; +import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../src/plugins/discover/public'; export const EmbeddableTypes: { lens: string; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.ts index bdb3c0e8c1b2ec..660605c4c54c12 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.ts @@ -6,7 +6,7 @@ import { get, map } from 'lodash'; import { Ticks, AxisConfig, isAxisConfig } from '../../../../types'; -import { Style, PointSeriesColumns } from '../../../../../../../../src/plugins/expressions/common'; +import { Style, PointSeriesColumns } from '../../../../../../../src/plugins/expressions/common'; type Position = 'bottom' | 'top' | 'left' | 'right'; interface Config { diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts index df316d0dd182f9..dacdc30e0c6f76 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts @@ -13,7 +13,7 @@ import { EmbeddableExpression, } from '../../expression_types'; import { getFunctionHelp } from '../../../i18n'; -import { MapEmbeddableInput } from '../../../../../plugins/maps/public'; +import { MapEmbeddableInput } from '../../../../../legacy/plugins/maps/public'; interface Arguments { id: string; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/escount.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/escount.ts index 2ab48fe0029791..142331aabf3514 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/escount.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/escount.ts @@ -10,7 +10,7 @@ import { } from 'src/plugins/expressions/common'; /* eslint-disable */ // @ts-ignore untyped local -import { buildESRequest } from '../../../../../../plugins/canvas/server/lib/build_es_request'; +import { buildESRequest } from '../../../server/lib/build_es_request'; /* eslint-enable */ import { getFunctionHelp } from '../../../i18n'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts index 180afc89322c3b..1eb0a7c74780cc 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts @@ -8,7 +8,7 @@ import squel from 'squel'; import { ExpressionFunctionDefinition } from 'src/plugins/expressions'; /* eslint-disable */ // @ts-ignore untyped local -import { queryEsSQL } from '../../../../../../plugins/canvas/server/lib/query_es_sql'; +import { queryEsSQL } from '../../../server/lib/query_es_sql'; /* eslint-enable */ import { ExpressionValueFilter } from '../../../types'; import { getFunctionHelp } from '../../../i18n'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/essql.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/essql.ts index 7c9cb92ad009c6..c64398d4b3a183 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/essql.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/essql.ts @@ -7,7 +7,7 @@ import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; /* eslint-disable */ // @ts-ignore untyped local -import { queryEsSQL } from '../../../../../../plugins/canvas/server/lib/query_es_sql'; +import { queryEsSQL } from '../../../server/lib/query_es_sql'; /* eslint-enable */ import { ExpressionValueFilter } from '../../../types'; import { getFunctionHelp } from '../../../i18n'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/plugin.ts b/x-pack/plugins/canvas/canvas_plugin_src/plugin.ts index 4452e5e9e31fea..c9ce4d065968a4 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/plugin.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/plugin.ts @@ -6,9 +6,9 @@ import { CoreSetup, CoreStart, Plugin } from 'src/core/public'; import { CanvasSetup } from '../public'; -import { EmbeddableStart } from '../../../../../src/plugins/embeddable/public'; -import { UiActionsStart } from '../../../../../src/plugins/ui_actions/public'; -import { Start as InspectorStart } from '../../../../../src/plugins/inspector/public'; +import { EmbeddableStart } from '../../../../src/plugins/embeddable/public'; +import { UiActionsStart } from '../../../../src/plugins/ui_actions/public'; +import { Start as InspectorStart } from '../../../../src/plugins/inspector/public'; import { functions } from './functions/browser'; import { typeFunctions } from './expression_types'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx index 1e8983a0ca5e52..0e0d5fd1953fe7 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx @@ -6,17 +6,17 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { CoreStart } from '../../../../../../../src/core/public'; +import { CoreStart } from '../../../../../../src/core/public'; import { StartDeps } from '../../plugin'; import { IEmbeddable, EmbeddableFactory, EmbeddablePanel, EmbeddableFactoryNotFoundError, -} from '../../../../../../../src/plugins/embeddable/public'; +} from '../../../../../../src/plugins/embeddable/public'; import { EmbeddableExpression } from '../../expression_types/embeddable'; import { RendererStrings } from '../../../i18n'; -import { getSavedObjectFinder } from '../../../../../../../src/plugins/saved_objects/public'; +import { getSavedObjectFinder } from '../../../../../../src/plugins/saved_objects/public'; import { embeddableInputToExpression } from './embeddable_input_to_expression'; import { EmbeddableInput } from '../../expression_types'; import { RendererHandlers } from '../../../types'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts index f9ff94ee7d8f16..e0e0aeaeea272a 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts @@ -5,7 +5,7 @@ */ import { toExpression } from './map'; -import { MapEmbeddableInput } from '../../../../../maps/public'; +import { MapEmbeddableInput } from '../../../../../../legacy/plugins/maps/public'; import { fromExpression, Ast } from '@kbn/interpreter/common'; const baseSavedMapInput = { diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.ts index e0cb71c17774c0..1f9bec133488c7 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MapEmbeddableInput } from '../../../../../maps/public'; +import { MapEmbeddableInput } from '../../../../../../legacy/plugins/maps/public'; export function toExpression(input: MapEmbeddableInput): string { const expressionParts = [] as string[]; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/markdown/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/markdown/index.js index 126699534caadb..a7b0f620cf7100 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/markdown/index.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/markdown/index.js @@ -7,7 +7,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { RendererStrings } from '../../../i18n'; -import { Markdown } from '../../../../../../../src/plugins/kibana_react/public'; +import { Markdown } from '../../../../../../src/plugins/kibana_react/public'; const { markdown: strings } = RendererStrings; diff --git a/x-pack/plugins/canvas/common/lib/autocomplete.ts b/x-pack/plugins/canvas/common/lib/autocomplete.ts index 50341c977d6d93..5ee4d2104a0f79 100644 --- a/x-pack/plugins/canvas/common/lib/autocomplete.ts +++ b/x-pack/plugins/canvas/common/lib/autocomplete.ts @@ -14,7 +14,7 @@ import { ExpressionFunction, ExpressionFunctionParameter, getByAlias, -} from '../../../../../../src/plugins/expressions'; +} from '../../../../../src/plugins/expressions'; const MARKER = 'CANVAS_SUGGESTION_MARKER'; diff --git a/x-pack/plugins/canvas/common/lib/fonts.ts b/x-pack/plugins/canvas/common/lib/fonts.ts index 14cc403af86ac3..e0d39f65f01c28 100644 --- a/x-pack/plugins/canvas/common/lib/fonts.ts +++ b/x-pack/plugins/canvas/common/lib/fonts.ts @@ -4,4 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -export * from '../../../../../../src/plugins/expressions/common/fonts'; +export * from '../../../../../src/plugins/expressions/common/fonts'; diff --git a/x-pack/plugins/canvas/public/legacy_register_feature.ts b/x-pack/plugins/canvas/common/lib/get_id.ts similarity index 53% rename from x-pack/plugins/canvas/public/legacy_register_feature.ts rename to x-pack/plugins/canvas/common/lib/get_id.ts index 00f788f267d4b1..0927a277f7caaf 100644 --- a/x-pack/plugins/canvas/public/legacy_register_feature.ts +++ b/x-pack/plugins/canvas/common/lib/get_id.ts @@ -4,11 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { npSetup } from 'ui/new_platform'; -import { featureCatalogueEntry } from './feature_catalogue_entry'; +import uuid from 'uuid/v4'; -const { - plugins: { home }, -} = npSetup; - -home.featureCatalogue.register(featureCatalogueEntry); +export function getId(type: string): string { + return `${type}-${uuid()}`; +} diff --git a/x-pack/plugins/canvas/i18n/elements/element_strings.test.ts b/x-pack/plugins/canvas/i18n/elements/element_strings.test.ts index c28229bdab33f0..1eff73c1525b1e 100644 --- a/x-pack/plugins/canvas/i18n/elements/element_strings.test.ts +++ b/x-pack/plugins/canvas/i18n/elements/element_strings.test.ts @@ -5,7 +5,7 @@ */ import { getElementStrings } from './element_strings'; import { initializeElements } from '../../canvas_plugin_src/elements'; -import { coreMock } from '../../../../../../src/core/public/mocks'; +import { coreMock } from '../../../../../src/core/public/mocks'; const elementSpecs = initializeElements(coreMock.createSetup() as any, {} as any); diff --git a/x-pack/plugins/canvas/public/application.tsx b/x-pack/plugins/canvas/public/application.tsx index 8ee65c3386afca..284023e74d137b 100644 --- a/x-pack/plugins/canvas/public/application.tsx +++ b/x-pack/plugins/canvas/public/application.tsx @@ -16,7 +16,7 @@ import { AppMountParameters, CoreStart, CoreSetup } from 'kibana/public'; import { CanvasStartDeps, CanvasSetupDeps } from './plugin'; // @ts-ignore Untyped local import { App } from './components/app'; -import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; +import { KibanaContextProvider } from '../../../../src/plugins/kibana_react/public'; import { initInterpreter, resetInterpreter } from './lib/run_interpreter'; import { registerLanguage } from './lib/monaco_language_def'; import { SetupRegistries } from './plugin_api'; @@ -26,9 +26,9 @@ import { getDocumentationLinks } from './lib/documentation_links'; import { HelpMenu } from './components/help_menu/help_menu'; import { createStore, destroyStore } from './store'; -import { VALUE_CLICK_TRIGGER, ActionByType } from '../../../../../src/plugins/ui_actions/public'; +import { VALUE_CLICK_TRIGGER, ActionByType } from '../../../../src/plugins/ui_actions/public'; /* eslint-disable */ -import { ACTION_VALUE_CLICK } from '../../../../../src/plugins/data/public/actions/value_click_action'; +import { ACTION_VALUE_CLICK } from '../../../../src/plugins/data/public/actions/value_click_action'; /* eslint-enable */ import { init as initStatsReporter } from './lib/ui_metric'; diff --git a/x-pack/plugins/canvas/public/components/asset_manager/index.ts b/x-pack/plugins/canvas/public/components/asset_manager/index.ts index 3fd34d6d2a9bb9..49894b9d874145 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/index.ts +++ b/x-pack/plugins/canvas/public/components/asset_manager/index.ts @@ -21,7 +21,7 @@ import { getId } from '../../lib/get_id'; // @ts-ignore Untyped Local import { findExistingAsset } from '../../lib/find_existing_asset'; import { VALID_IMAGE_TYPES } from '../../../common/lib/constants'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { WithKibanaProps } from '../../'; import { AssetManager as Component, Props as AssetManagerProps } from './asset_manager'; diff --git a/x-pack/plugins/canvas/public/components/element_content/index.js b/x-pack/plugins/canvas/public/components/element_content/index.js index df411b6d11f1c1..3d7cca95e10b72 100644 --- a/x-pack/plugins/canvas/public/components/element_content/index.js +++ b/x-pack/plugins/canvas/public/components/element_content/index.js @@ -9,7 +9,7 @@ import { connect } from 'react-redux'; import { compose, withProps } from 'recompose'; import { get } from 'lodash'; import { getSelectedPage, getPageById } from '../../state/selectors/workpad'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { ElementContent as Component } from './element_content'; const mapStateToProps = state => ({ diff --git a/x-pack/plugins/canvas/public/components/embeddable_flyout/flyout.tsx b/x-pack/plugins/canvas/public/components/embeddable_flyout/flyout.tsx index 4916a27fcbe60a..35eedde59a0146 100644 --- a/x-pack/plugins/canvas/public/components/embeddable_flyout/flyout.tsx +++ b/x-pack/plugins/canvas/public/components/embeddable_flyout/flyout.tsx @@ -9,9 +9,9 @@ import { EuiFlyout, EuiFlyoutHeader, EuiFlyoutBody, EuiTitle } from '@elastic/eu import { SavedObjectFinderUi, SavedObjectMetaData, -} from '../../../../../../../src/plugins/saved_objects/public/'; +} from '../../../../../../src/plugins/saved_objects/public/'; import { ComponentStrings } from '../../../i18n'; -import { CoreStart } from '../../../../../../../src/core/public'; +import { CoreStart } from '../../../../../../src/core/public'; import { CanvasStartDeps } from '../../plugin'; const { AddEmbeddableFlyout: strings } = ComponentStrings; diff --git a/x-pack/plugins/canvas/public/components/embeddable_flyout/index.tsx b/x-pack/plugins/canvas/public/components/embeddable_flyout/index.tsx index c13cbfd0422377..8e69396f67c2e2 100644 --- a/x-pack/plugins/canvas/public/components/embeddable_flyout/index.tsx +++ b/x-pack/plugins/canvas/public/components/embeddable_flyout/index.tsx @@ -15,7 +15,7 @@ import { addElement } from '../../state/actions/elements'; import { getSelectedPage } from '../../state/selectors/workpad'; import { EmbeddableTypes } from '../../../canvas_plugin_src/expression_types/embeddable'; import { WithKibanaProps } from '../../index'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; const allowedEmbeddables = { [EmbeddableTypes.map]: (id: string) => { diff --git a/x-pack/plugins/canvas/public/components/expression/index.js b/x-pack/plugins/canvas/public/components/expression/index.js index 29d22c0e1804a3..c2b559fe032300 100644 --- a/x-pack/plugins/canvas/public/components/expression/index.js +++ b/x-pack/plugins/canvas/public/components/expression/index.js @@ -15,7 +15,7 @@ import { renderComponent, } from 'recompose'; import { fromExpression } from '@kbn/interpreter/common'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { getSelectedPage, getSelectedElement } from '../../state/selectors/workpad'; import { setExpression, flushContext } from '../../state/actions/elements'; import { ElementNotSelected } from './element_not_selected'; diff --git a/x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx b/x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx index faac2ae883c13f..99e12b14104be1 100644 --- a/x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx +++ b/x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx @@ -9,8 +9,8 @@ import PropTypes from 'prop-types'; import { EuiFormRow } from '@elastic/eui'; import { debounce } from 'lodash'; import { monaco } from '@kbn/ui-shared-deps/monaco'; -import { ExpressionFunction } from '../../../../../../../src/plugins/expressions'; -import { CodeEditor } from '../../../../../../../src/plugins/kibana_react/public'; +import { ExpressionFunction } from '../../../types'; +import { CodeEditor } from '../../../../../../src/plugins/kibana_react/public'; import { AutocompleteSuggestion, getAutocompleteSuggestions, diff --git a/x-pack/plugins/canvas/public/components/expression_input/reference.ts b/x-pack/plugins/canvas/public/components/expression_input/reference.ts index ca3819195fcbd1..a24dacf0664757 100644 --- a/x-pack/plugins/canvas/public/components/expression_input/reference.ts +++ b/x-pack/plugins/canvas/public/components/expression_input/reference.ts @@ -8,7 +8,7 @@ import { ComponentStrings } from '../../../i18n'; import { ExpressionFunction, ExpressionFunctionParameter, -} from '../../../../../../../src/plugins/expressions'; +} from '../../../../../../src/plugins/expressions'; const { ExpressionInput: strings } = ComponentStrings; diff --git a/x-pack/plugins/canvas/public/components/render_with_fn/index.js b/x-pack/plugins/canvas/public/components/render_with_fn/index.js index cc234d2287c0cc..473aaaf9d1ac6a 100644 --- a/x-pack/plugins/canvas/public/components/render_with_fn/index.js +++ b/x-pack/plugins/canvas/public/components/render_with_fn/index.js @@ -7,7 +7,7 @@ import { compose, withProps, withPropsOnChange } from 'recompose'; import PropTypes from 'prop-types'; import isEqual from 'react-fast-compare'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { RenderWithFn as Component } from './render_with_fn'; import { ElementHandlers } from './lib/handlers'; diff --git a/x-pack/plugins/canvas/public/components/saved_elements_modal/index.ts b/x-pack/plugins/canvas/public/components/saved_elements_modal/index.ts index 60d1d7462daa9f..f14fc92e028dba 100644 --- a/x-pack/plugins/canvas/public/components/saved_elements_modal/index.ts +++ b/x-pack/plugins/canvas/public/components/saved_elements_modal/index.ts @@ -11,7 +11,7 @@ import { camelCase } from 'lodash'; // @ts-ignore Untyped local import { cloneSubgraphs } from '../../lib/clone_subgraphs'; import * as customElementService from '../../lib/custom_element_service'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { WithKibanaProps } from '../../'; // @ts-ignore Untyped local import { selectToplevelNodes } from '../../state/actions/transient'; diff --git a/x-pack/plugins/canvas/public/components/workpad_header/element_menu/index.tsx b/x-pack/plugins/canvas/public/components/workpad_header/element_menu/index.tsx index 40571a9341f69c..a1227b33946785 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/element_menu/index.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_header/element_menu/index.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { compose, withProps } from 'recompose'; import { Dispatch } from 'redux'; -import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public/'; +import { withKibana } from '../../../../../../../src/plugins/kibana_react/public/'; import { State, ElementSpec } from '../../../../types'; // @ts-ignore Untyped local import { elementsRegistry } from '../../../lib/elements_registry'; diff --git a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/index.ts b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/index.ts index 4377635acac881..1ed39b62cccada 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/index.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/index.ts @@ -25,7 +25,7 @@ import { API_ROUTE_SHAREABLE_ZIP } from '../../../../../common/lib/constants'; import { renderFunctionNames } from '../../../../../shareable_runtime/supported_renderers'; import { ComponentStrings } from '../../../../../i18n/components'; -import { withKibana } from '../../../../../../../../../src/plugins/kibana_react/public/'; +import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public/'; import { OnCloseFn } from '../share_menu'; import { WithKibanaProps } from '../../../../index'; const { WorkpadHeaderShareMenu: strings } = ComponentStrings; diff --git a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/index.ts b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/index.ts index d6565f0e43db7c..9a8936ada6d1e3 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/index.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/index.ts @@ -6,14 +6,14 @@ import { connect } from 'react-redux'; import { compose, withProps } from 'recompose'; -import { jobCompletionNotifications } from '../../../../../../../plugins/reporting/public'; +import { jobCompletionNotifications } from '../../../../../../plugins/reporting/public'; import { getWorkpad, getPages } from '../../../state/selectors/workpad'; import { getWindow } from '../../../lib/get_window'; import { downloadWorkpad } from '../../../lib/download_workpad'; import { ShareMenu as Component, Props as ComponentProps } from './share_menu'; import { getPdfUrl, createPdf } from './utils'; import { State, CanvasWorkpad } from '../../../../types'; -import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public/'; +import { withKibana } from '../../../../../../../src/plugins/kibana_react/public/'; import { WithKibanaProps } from '../../../index'; import { ComponentStrings } from '../../../../i18n'; diff --git a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts index dc99c0687f388e..8a3438e89e8465 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts @@ -9,7 +9,7 @@ import rison from 'rison-node'; import { IBasePath } from 'kibana/public'; import { fetch } from '../../../../common/lib/fetch'; import { CanvasWorkpad } from '../../../../types'; -import { url } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { url } from '../../../../../../../src/plugins/kibana_utils/public'; // type of the desired pdf output (print or preserve_layout) const PDF_LAYOUT_TYPE = 'preserve_layout'; diff --git a/x-pack/plugins/canvas/public/components/workpad_header/view_menu/index.ts b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/index.ts index e1ad9782c8aef5..e561607cb101e1 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/view_menu/index.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/index.ts @@ -7,7 +7,7 @@ import { connect } from 'react-redux'; import { compose, withHandlers } from 'recompose'; import { Dispatch } from 'redux'; -import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public/'; +import { withKibana } from '../../../../../../../src/plugins/kibana_react/public/'; import { zoomHandlerCreators } from '../../../lib/app_handler_creators'; import { State, CanvasWorkpadBoundingBox } from '../../../../types'; // @ts-ignore Untyped local diff --git a/x-pack/plugins/canvas/public/components/workpad_loader/index.js b/x-pack/plugins/canvas/public/components/workpad_loader/index.js index 9379379e54d97b..8b190338db49e3 100644 --- a/x-pack/plugins/canvas/public/components/workpad_loader/index.js +++ b/x-pack/plugins/canvas/public/components/workpad_loader/index.js @@ -14,7 +14,7 @@ import { getWorkpad } from '../../state/selectors/workpad'; import { getId } from '../../lib/get_id'; import { downloadWorkpad } from '../../lib/download_workpad'; import { ComponentStrings, ErrorStrings } from '../../../i18n'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { WorkpadLoader as Component } from './workpad_loader'; const { WorkpadLoader: strings } = ComponentStrings; diff --git a/x-pack/plugins/canvas/public/components/workpad_templates/index.js b/x-pack/plugins/canvas/public/components/workpad_templates/index.js index 1890ca1f9d2d67..a17b77b74e499f 100644 --- a/x-pack/plugins/canvas/public/components/workpad_templates/index.js +++ b/x-pack/plugins/canvas/public/components/workpad_templates/index.js @@ -9,7 +9,7 @@ import { compose, getContext, withHandlers, withProps } from 'recompose'; import * as workpadService from '../../lib/workpad_service'; import { getId } from '../../lib/get_id'; import { templatesRegistry } from '../../lib/templates_registry'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { WorkpadTemplates as Component } from './workpad_templates'; export const WorkpadTemplates = compose( diff --git a/x-pack/plugins/canvas/public/feature_catalogue_entry.ts b/x-pack/plugins/canvas/public/feature_catalogue_entry.ts index f610bd0299832a..41506bdd71e3c4 100644 --- a/x-pack/plugins/canvas/public/feature_catalogue_entry.ts +++ b/x-pack/plugins/canvas/public/feature_catalogue_entry.ts @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; +import { FeatureCatalogueCategory } from '../../../../src/plugins/home/public'; export const featureCatalogueEntry = { id: 'canvas', diff --git a/x-pack/plugins/canvas/public/index.ts b/x-pack/plugins/canvas/public/index.ts index 736d5ccc0f8e59..d36f89354934ab 100644 --- a/x-pack/plugins/canvas/public/index.ts +++ b/x-pack/plugins/canvas/public/index.ts @@ -5,6 +5,16 @@ */ import { PluginInitializerContext } from 'kibana/public'; -import { CanvasPlugin } from '../../../legacy/plugins/canvas/public/plugin'; +import { CoreStart } from '../../../../src/core/public'; +import { CanvasServices } from './services'; +import { CanvasSetup, CanvasStart, CanvasStartDeps, CanvasPlugin } from './plugin'; + +export { CanvasSetup, CanvasStart }; + +export interface WithKibanaProps { + kibana: { + services: CoreStart & CanvasStartDeps & { canvas: CanvasServices }; + }; +} export const plugin = (initializerContext: PluginInitializerContext) => new CanvasPlugin(); diff --git a/x-pack/plugins/canvas/public/legacy.ts b/x-pack/plugins/canvas/public/legacy.ts deleted file mode 100644 index f4a2b309b34993..00000000000000 --- a/x-pack/plugins/canvas/public/legacy.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { npSetup, npStart } from 'ui/new_platform'; -import { CanvasStartDeps, CanvasSetupDeps } from './plugin'; // eslint-disable-line import/order - -// @ts-ignore Untyped Kibana Lib -import chrome, { loadingCount } from 'ui/chrome'; // eslint-disable-line import/order -// @ts-ignore Untyped Kibana Lib -import { formatMsg } from '../../../../../src/plugins/kibana_legacy/public'; // eslint-disable-line import/order - -const shimCoreSetup = { - ...npSetup.core, -}; -const shimCoreStart = { - ...npStart.core, -}; - -const shimSetupPlugins: CanvasSetupDeps = { - data: npSetup.plugins.data, - expressions: npSetup.plugins.expressions, - home: npSetup.plugins.home, - usageCollection: npSetup.plugins.usageCollection, -}; -const shimStartPlugins: CanvasStartDeps = { - ...npStart.plugins, - embeddable: npStart.plugins.embeddable, - expressions: npStart.plugins.expressions, - inspector: npStart.plugins.inspector, - uiActions: npStart.plugins.uiActions, -}; - -// These methods are intended to be a replacement for import from 'ui/whatever' -// These will go away once all of this one plugin start/setup properly -// injects wherever these need to go. -export function getCoreSetup() { - return shimCoreSetup; -} - -export function getCoreStart() { - return shimCoreStart; -} - -export function getSetupPlugins() { - return shimSetupPlugins; -} - -export function getStartPlugins() { - return shimStartPlugins; -} diff --git a/x-pack/plugins/canvas/public/legacy_plugin_support.ts b/x-pack/plugins/canvas/public/legacy_plugin_support.ts deleted file mode 100644 index cfc3de8f6d54c2..00000000000000 --- a/x-pack/plugins/canvas/public/legacy_plugin_support.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -// @ts-ignore -import { Registry, registryFactory } from '@kbn/interpreter/common'; - -type specFn = (...args: any[]) => { name: string }; - -const fnWrapper = (fn: specFn) => { - const obj = fn(); - return () => ({ - name: obj.name, - fn, - }); -}; - -class LegacyRegistry extends Registry { - register(fn: specFn) { - super.register(fnWrapper(fn)); - } - - getOriginalFns() { - return this.toArray().map(entry => entry.fn); - } -} - -export const legacyRegistries = { - browserFunctions: new LegacyRegistry(), - renderers: new LegacyRegistry(), - types: new LegacyRegistry(), - elements: new LegacyRegistry(), - transformUIs: new LegacyRegistry(), - datasourceUIs: new LegacyRegistry(), - modelUIs: new LegacyRegistry(), - viewUIs: new LegacyRegistry(), - argumentUIs: new LegacyRegistry(), - templates: new LegacyRegistry(), - tagUIs: new LegacyRegistry(), -}; - -(global as any).kbnInterpreter = Object.assign( - (global as any).kbnInterpreter || {}, - registryFactory(legacyRegistries) -); diff --git a/x-pack/plugins/canvas/public/legacy_register_interpreter.ts b/x-pack/plugins/canvas/public/legacy_register_interpreter.ts deleted file mode 100644 index 274a9875d123d6..00000000000000 --- a/x-pack/plugins/canvas/public/legacy_register_interpreter.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { npSetup } from 'ui/new_platform'; -import { functions } from '../canvas_plugin_src/functions/browser'; -import { typeFunctions } from '../canvas_plugin_src/expression_types'; -// @ts-ignore untyped local -import { renderFunctions } from '../canvas_plugin_src/renderers'; - -functions.forEach(npSetup.plugins.expressions.registerFunction); -typeFunctions.forEach(npSetup.plugins.expressions.registerType); -renderFunctions.forEach(npSetup.plugins.expressions.registerRenderer); - -// eslint-disable-next-line import/no-default-export -export default functions; diff --git a/x-pack/plugins/canvas/public/legacy_start.ts b/x-pack/plugins/canvas/public/legacy_start.ts deleted file mode 100644 index ac647fe8a5a931..00000000000000 --- a/x-pack/plugins/canvas/public/legacy_start.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -// TODO: These are legacy imports. We should work to have all of these come from New Platform -// Import the uiExports that the application uses -// These will go away as these plugins are converted to NP -import 'ui/autoload/all'; -import 'uiExports/savedObjectTypes'; -import 'uiExports/spyModes'; -import 'uiExports/embeddableFactories'; -import 'uiExports/interpreter'; - -import './legacy_plugin_support'; -// load application code -import 'uiExports/canvas'; - -import { PluginInitializerContext } from '../../../../../src/core/public'; -import { plugin } from './'; -import { getCoreStart, getStartPlugins, getSetupPlugins, getCoreSetup } from './legacy'; -const pluginInstance = plugin({} as PluginInitializerContext); - -// Setup and Startup the plugin -export const setup = pluginInstance.setup(getCoreSetup(), getSetupPlugins()); -export const start = pluginInstance.start(getCoreStart(), getStartPlugins()); diff --git a/x-pack/plugins/canvas/public/lib/breadcrumbs.ts b/x-pack/plugins/canvas/public/lib/breadcrumbs.ts index 57b513affd7815..96412ef50c79de 100644 --- a/x-pack/plugins/canvas/public/lib/breadcrumbs.ts +++ b/x-pack/plugins/canvas/public/lib/breadcrumbs.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ChromeBreadcrumb } from '../../../../../../src/core/public'; +import { ChromeBreadcrumb } from '../../../../../src/core/public'; import { platformService } from '../services'; export const getBaseBreadcrumb = () => ({ diff --git a/x-pack/plugins/canvas/public/lib/build_embeddable_filters.ts b/x-pack/plugins/canvas/public/lib/build_embeddable_filters.ts index aa915d0d3d02a4..9aa7477523c9a1 100644 --- a/x-pack/plugins/canvas/public/lib/build_embeddable_filters.ts +++ b/x-pack/plugins/canvas/public/lib/build_embeddable_filters.ts @@ -7,11 +7,7 @@ import { ExpressionValueFilter } from '../../types'; // @ts-ignore Untyped Local import { buildBoolArray } from './build_bool_array'; -import { - TimeRange, - esFilters, - Filter as DataFilter, -} from '../../../../../../src/plugins/data/public'; +import { TimeRange, esFilters, Filter as DataFilter } from '../../../../../src/plugins/data/public'; export interface EmbeddableFilterInput { filters: DataFilter[]; diff --git a/x-pack/plugins/canvas/public/lib/clipboard.test.ts b/x-pack/plugins/canvas/public/lib/clipboard.test.ts index 54c3000dae36ca..d10964003ed391 100644 --- a/x-pack/plugins/canvas/public/lib/clipboard.test.ts +++ b/x-pack/plugins/canvas/public/lib/clipboard.test.ts @@ -3,9 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -jest.mock('../../../../../../src/plugins/kibana_utils/public'); +jest.mock('../../../../../src/plugins/kibana_utils/public'); -import { Storage } from '../../../../../../src/plugins/kibana_utils/public'; +import { Storage } from '../../../../../src/plugins/kibana_utils/public'; import { setClipboardData, getClipboardData } from './clipboard'; import { LOCALSTORAGE_CLIPBOARD } from '../../common/lib/constants'; import { elements } from '../../__tests__/fixtures/workpads'; diff --git a/x-pack/plugins/canvas/public/lib/clipboard.ts b/x-pack/plugins/canvas/public/lib/clipboard.ts index 50c5cdd0042fd4..11755807aa5336 100644 --- a/x-pack/plugins/canvas/public/lib/clipboard.ts +++ b/x-pack/plugins/canvas/public/lib/clipboard.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Storage } from '../../../../../../src/plugins/kibana_utils/public'; +import { Storage } from '../../../../../src/plugins/kibana_utils/public'; import { LOCALSTORAGE_CLIPBOARD } from '../../common/lib/constants'; import { getWindow } from './get_window'; diff --git a/x-pack/plugins/canvas/public/plugin.tsx b/x-pack/plugins/canvas/public/plugin.tsx index 1e85aad6328a55..6273aebe30e656 100644 --- a/x-pack/plugins/canvas/public/plugin.tsx +++ b/x-pack/plugins/canvas/public/plugin.tsx @@ -10,20 +10,19 @@ import { Plugin, AppMountParameters, DEFAULT_APP_CATEGORIES, -} from '../../../../../src/core/public'; -import { HomePublicPluginSetup } from '../../../../../src/plugins/home/public'; +} from '../../../../src/core/public'; +import { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; import { initLoadingIndicator } from './lib/loading_indicator'; import { featureCatalogueEntry } from './feature_catalogue_entry'; -import { ExpressionsSetup, ExpressionsStart } from '../../../../../src/plugins/expressions/public'; -import { DataPublicPluginSetup } from '../../../../../src/plugins/data/public'; -import { UiActionsStart } from '../../../../../src/plugins/ui_actions/public'; -import { EmbeddableStart } from '../../../../../src/plugins/embeddable/public'; -import { UsageCollectionSetup } from '../../../../../src/plugins/usage_collection/public'; -import { Start as InspectorStart } from '../../../../../src/plugins/inspector/public'; +import { ExpressionsSetup, ExpressionsStart } from '../../../../src/plugins/expressions/public'; +import { DataPublicPluginSetup } from '../../../../src/plugins/data/public'; +import { UiActionsStart } from '../../../../src/plugins/ui_actions/public'; +import { EmbeddableStart } from '../../../../src/plugins/embeddable/public'; +import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/public'; +import { Start as InspectorStart } from '../../../../src/plugins/inspector/public'; // @ts-ignore untyped local import { argTypeSpecs } from './expression_types/arg_types'; import { transitions } from './transitions'; -import { legacyRegistries } from './legacy_plugin_support'; import { getPluginApi, CanvasApi } from './plugin_api'; import { initFunctions } from './functions'; import { CanvasSrcPlugin } from '../canvas_plugin_src/plugin'; @@ -95,11 +94,6 @@ export class CanvasPlugin plugins.home.featureCatalogue.register(featureCatalogueEntry); - // Register Legacy plugin stuff - canvasApi.addFunctions(legacyRegistries.browserFunctions.getOriginalFns()); - canvasApi.addElements(legacyRegistries.elements.getOriginalFns()); - canvasApi.addTypes(legacyRegistries.types.getOriginalFns()); - // Register core canvas stuff canvasApi.addFunctions( initFunctions({ diff --git a/x-pack/plugins/canvas/public/plugin_api.ts b/x-pack/plugins/canvas/public/plugin_api.ts index a7346c0b4376e4..738b319d29c0b4 100644 --- a/x-pack/plugins/canvas/public/plugin_api.ts +++ b/x-pack/plugins/canvas/public/plugin_api.ts @@ -9,7 +9,7 @@ import { RendererFactory, } from '../types'; import { ElementFactory } from '../types'; -import { ExpressionsSetup } from '../../../../../src/plugins/expressions/public'; +import { ExpressionsSetup } from '../../../../src/plugins/expressions/public'; type AddToRegistry = (add: T[]) => void; diff --git a/x-pack/plugins/canvas/public/services/index.ts b/x-pack/plugins/canvas/public/services/index.ts index 17d836f1441c96..abc46beaa3e64e 100644 --- a/x-pack/plugins/canvas/public/services/index.ts +++ b/x-pack/plugins/canvas/public/services/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CoreSetup, CoreStart } from '../../../../../../src/core/public'; +import { CoreSetup, CoreStart } from '../../../../../src/core/public'; import { CanvasSetupDeps, CanvasStartDeps } from '../plugin'; import { notifyServiceFactory } from './notify'; import { platformServiceFactory } from './platform'; diff --git a/x-pack/plugins/canvas/public/services/notify.ts b/x-pack/plugins/canvas/public/services/notify.ts index 3e18e2178a8181..5454a0f87c3f06 100644 --- a/x-pack/plugins/canvas/public/services/notify.ts +++ b/x-pack/plugins/canvas/public/services/notify.ts @@ -6,8 +6,8 @@ import { get } from 'lodash'; import { CanvasServiceFactory } from '.'; -import { formatMsg } from '../../../../../../src/plugins/kibana_legacy/public'; -import { ToastInputFields } from '../../../../../../src/core/public'; +import { formatMsg } from '../../../../../src/plugins/kibana_legacy/public'; +import { ToastInputFields } from '../../../../../src/core/public'; const getToast = (err: Error | string, opts: ToastInputFields = {}) => { const errData = (get(err, 'response') || err) as Error | string; diff --git a/x-pack/plugins/canvas/public/state/selectors/workpad.ts b/x-pack/plugins/canvas/public/state/selectors/workpad.ts index 80a7c34e8bef59..ae5c0fee520620 100644 --- a/x-pack/plugins/canvas/public/state/selectors/workpad.ts +++ b/x-pack/plugins/canvas/public/state/selectors/workpad.ts @@ -16,12 +16,10 @@ import { CanvasGroup, PositionedElement, CanvasWorkpadBoundingBox, -} from '../../../types'; -import { ExpressionAstArgument, ExpressionAstFunction, ExpressionAstExpression, -} from '../../../../../../../src/plugins/expressions/common'; +} from '../../../types'; type Modify = Pick> & R; type WorkpadInfo = Modify; diff --git a/x-pack/plugins/canvas/public/store.ts b/x-pack/plugins/canvas/public/store.ts index 1460932101725b..8560e612de4dbf 100644 --- a/x-pack/plugins/canvas/public/store.ts +++ b/x-pack/plugins/canvas/public/store.ts @@ -9,7 +9,7 @@ import { createStore as createReduxStore, destroyStore as destroy } from './stat // @ts-ignore Untyped local import { getInitialState } from './state/initial_state'; -import { CoreSetup } from '../../../../../src/core/public'; +import { CoreSetup } from '../../../../src/core/public'; import { CanvasSetupDeps } from './plugin'; export async function createStore(core: CoreSetup, plugins: CanvasSetupDeps) { diff --git a/x-pack/plugins/canvas/server/collectors/collector.ts b/x-pack/plugins/canvas/server/collectors/collector.ts index 8e9e5ede2e7f20..88e5e43dc2af1c 100644 --- a/x-pack/plugins/canvas/server/collectors/collector.ts +++ b/x-pack/plugins/canvas/server/collectors/collector.ts @@ -6,7 +6,7 @@ import { CallCluster } from 'src/legacy/core_plugins/elasticsearch'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; -import { CANVAS_USAGE_TYPE } from '../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_USAGE_TYPE } from '../../common/lib/constants'; import { TelemetryCollector } from '../../types'; import { workpadCollector } from './workpad_collector'; diff --git a/x-pack/plugins/canvas/server/collectors/workpad_collector.test.ts b/x-pack/plugins/canvas/server/collectors/workpad_collector.test.ts index 70bc074ff3df8b..420b785771bfed 100644 --- a/x-pack/plugins/canvas/server/collectors/workpad_collector.test.ts +++ b/x-pack/plugins/canvas/server/collectors/workpad_collector.test.ts @@ -6,7 +6,7 @@ import clonedeep from 'lodash.clonedeep'; import { summarizeWorkpads } from './workpad_collector'; -import { workpads } from '../../../../legacy/plugins/canvas/__tests__/fixtures/workpads'; +import { workpads } from '../../__tests__/fixtures/workpads'; describe('usage collector handle es response data', () => { it('should summarize workpads, pages, and elements', () => { diff --git a/x-pack/plugins/canvas/server/collectors/workpad_collector.ts b/x-pack/plugins/canvas/server/collectors/workpad_collector.ts index 9c088958c748f7..b14a35ded4781c 100644 --- a/x-pack/plugins/canvas/server/collectors/workpad_collector.ts +++ b/x-pack/plugins/canvas/server/collectors/workpad_collector.ts @@ -6,7 +6,7 @@ import { SearchParams } from 'elasticsearch'; import { sum as arraySum, min as arrayMin, max as arrayMax, get } from 'lodash'; -import { CANVAS_TYPE } from '../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../common/lib/constants'; import { collectFns } from './collector_helpers'; import { TelemetryCollector, CanvasWorkpad } from '../../types'; import { parseExpression } from '../../../../../src/plugins/expressions/common'; diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/create.test.ts b/x-pack/plugins/canvas/server/routes/custom_elements/create.test.ts index d3a69c01732fa6..c260d6ca8ac16b 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/create.test.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/create.test.ts @@ -11,7 +11,7 @@ import { httpServerMock, loggingServiceMock, } from 'src/core/server/mocks'; -import { CUSTOM_ELEMENT_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE } from '../../../common/lib/constants'; import { initializeCreateCustomElementRoute } from './create'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/create.ts b/x-pack/plugins/canvas/server/routes/custom_elements/create.ts index b8828291246966..1c3b9221c52cd0 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/create.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/create.ts @@ -5,11 +5,8 @@ */ import { RouteInitializerDeps } from '../'; -import { - CUSTOM_ELEMENT_TYPE, - API_ROUTE_CUSTOM_ELEMENT, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; -import { getId } from '../../../../../legacy/plugins/canvas/public/lib/get_id'; +import { CUSTOM_ELEMENT_TYPE, API_ROUTE_CUSTOM_ELEMENT } from '../../../common/lib/constants'; +import { getId } from '../../../common/lib/get_id'; import { CustomElementSchema } from './custom_element_schema'; import { CustomElementAttributes } from './custom_element_attributes'; import { okResponse } from '../ok_response'; diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/custom_element_attributes.ts b/x-pack/plugins/canvas/server/routes/custom_elements/custom_element_attributes.ts index e76526eeeb27b9..772ebb1d79a5e9 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/custom_element_attributes.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/custom_element_attributes.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { CustomElement } from '../../../../../legacy/plugins/canvas/types'; +import { CustomElement } from '../../../types'; // Exclude ID attribute for the type used for SavedObjectClient export type CustomElementAttributes = Pick> & { diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/delete.test.ts b/x-pack/plugins/canvas/server/routes/custom_elements/delete.test.ts index c108f2316db272..e70fae5d18eaf2 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/delete.test.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/delete.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CUSTOM_ELEMENT_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE } from '../../../common/lib/constants'; import { initializeDeleteCustomElementRoute } from './delete'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/delete.ts b/x-pack/plugins/canvas/server/routes/custom_elements/delete.ts index 5867539b95b532..b9d52ccfbac80c 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/delete.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/delete.ts @@ -6,10 +6,7 @@ import { schema } from '@kbn/config-schema'; import { RouteInitializerDeps } from '../'; -import { - CUSTOM_ELEMENT_TYPE, - API_ROUTE_CUSTOM_ELEMENT, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE, API_ROUTE_CUSTOM_ELEMENT } from '../../../common/lib/constants'; import { okResponse } from '../ok_response'; import { catchErrorHandler } from '../catch_error_handler'; diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/find.ts b/x-pack/plugins/canvas/server/routes/custom_elements/find.ts index 5041ceb3e4711d..964618adf165d2 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/find.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/find.ts @@ -7,10 +7,7 @@ import { schema } from '@kbn/config-schema'; import { SavedObjectAttributes } from 'src/core/server'; import { RouteInitializerDeps } from '../'; -import { - CUSTOM_ELEMENT_TYPE, - API_ROUTE_CUSTOM_ELEMENT, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE, API_ROUTE_CUSTOM_ELEMENT } from '../../../common/lib/constants'; export function initializeFindCustomElementsRoute(deps: RouteInitializerDeps) { const { router } = deps; diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/get.test.ts b/x-pack/plugins/canvas/server/routes/custom_elements/get.test.ts index 5e8d536f779a9a..03ae6048801bf2 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/get.test.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/get.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CUSTOM_ELEMENT_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE } from '../../../common/lib/constants'; import { initializeGetCustomElementRoute } from './get'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/get.ts b/x-pack/plugins/canvas/server/routes/custom_elements/get.ts index f092b001e141f7..bb8e320a7c1244 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/get.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/get.ts @@ -6,10 +6,7 @@ import { schema } from '@kbn/config-schema'; import { RouteInitializerDeps } from '../'; -import { - CUSTOM_ELEMENT_TYPE, - API_ROUTE_CUSTOM_ELEMENT, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE, API_ROUTE_CUSTOM_ELEMENT } from '../../../common/lib/constants'; import { CustomElementAttributes } from './custom_element_attributes'; import { catchErrorHandler } from '../catch_error_handler'; diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/update.test.ts b/x-pack/plugins/canvas/server/routes/custom_elements/update.test.ts index 285a998030cf63..e67e42c26cd2b6 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/update.test.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/update.test.ts @@ -5,8 +5,8 @@ */ import sinon from 'sinon'; -import { CustomElement } from '../../../../../legacy/plugins/canvas/types'; -import { CUSTOM_ELEMENT_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CustomElement } from '../../../types'; +import { CUSTOM_ELEMENT_TYPE } from '../../../common/lib/constants'; import { initializeUpdateCustomElementRoute } from './update'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/update.ts b/x-pack/plugins/canvas/server/routes/custom_elements/update.ts index 51c363249dd793..a65d23d8c14060 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/update.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/update.ts @@ -7,10 +7,7 @@ import { schema } from '@kbn/config-schema'; import { omit } from 'lodash'; import { RouteInitializerDeps } from '../'; -import { - CUSTOM_ELEMENT_TYPE, - API_ROUTE_CUSTOM_ELEMENT, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE, API_ROUTE_CUSTOM_ELEMENT } from '../../../common/lib/constants'; import { CustomElementUpdateSchema } from './custom_element_schema'; import { CustomElementAttributes } from './custom_element_attributes'; import { okResponse } from '../ok_response'; diff --git a/x-pack/plugins/canvas/server/routes/es_fields/es_fields.ts b/x-pack/plugins/canvas/server/routes/es_fields/es_fields.ts index 5282a246de6b6a..5ebf20095bf3e5 100644 --- a/x-pack/plugins/canvas/server/routes/es_fields/es_fields.ts +++ b/x-pack/plugins/canvas/server/routes/es_fields/es_fields.ts @@ -6,7 +6,7 @@ import { mapValues, keys } from 'lodash'; import { schema } from '@kbn/config-schema'; -import { API_ROUTE } from '../../../../../legacy/plugins/canvas/common/lib'; +import { API_ROUTE } from '../../../common/lib'; import { catchErrorHandler } from '../catch_error_handler'; // @ts-ignore unconverted lib import { normalizeType } from '../../lib/normalize_type'; diff --git a/x-pack/plugins/canvas/server/routes/shareables/download.ts b/x-pack/plugins/canvas/server/routes/shareables/download.ts index 08bec1e4881aeb..3f331c1635e16b 100644 --- a/x-pack/plugins/canvas/server/routes/shareables/download.ts +++ b/x-pack/plugins/canvas/server/routes/shareables/download.ts @@ -5,9 +5,9 @@ */ import { readFileSync } from 'fs'; -import { SHAREABLE_RUNTIME_FILE } from '../../../../../legacy/plugins/canvas/shareable_runtime/constants'; +import { SHAREABLE_RUNTIME_FILE } from '../../../shareable_runtime/constants'; import { RouteInitializerDeps } from '../'; -import { API_ROUTE_SHAREABLE_RUNTIME_DOWNLOAD } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { API_ROUTE_SHAREABLE_RUNTIME_DOWNLOAD } from '../../../common/lib/constants'; export function initializeDownloadShareableWorkpadRoute(deps: RouteInitializerDeps) { const { router } = deps; diff --git a/x-pack/plugins/canvas/server/routes/shareables/zip.test.ts b/x-pack/plugins/canvas/server/routes/shareables/zip.test.ts index edb59694a74005..63776f897a04ca 100644 --- a/x-pack/plugins/canvas/server/routes/shareables/zip.test.ts +++ b/x-pack/plugins/canvas/server/routes/shareables/zip.test.ts @@ -15,12 +15,12 @@ import { } from 'src/core/server'; import { httpServiceMock, httpServerMock, loggingServiceMock } from 'src/core/server/mocks'; import { initializeZipShareableWorkpadRoute } from './zip'; -import { API_ROUTE_SHAREABLE_ZIP } from '../../../../../legacy/plugins/canvas/common/lib'; +import { API_ROUTE_SHAREABLE_ZIP } from '../../../common/lib'; import { SHAREABLE_RUNTIME_FILE, SHAREABLE_RUNTIME_SRC, SHAREABLE_RUNTIME_NAME, -} from '../../../../../legacy/plugins/canvas/shareable_runtime/constants'; +} from '../../../shareable_runtime/constants'; const mockRouteContext = {} as RequestHandlerContext; const mockWorkpad = {}; diff --git a/x-pack/plugins/canvas/server/routes/shareables/zip.ts b/x-pack/plugins/canvas/server/routes/shareables/zip.ts index e25b96cce96ff3..99f401cd4c142b 100644 --- a/x-pack/plugins/canvas/server/routes/shareables/zip.ts +++ b/x-pack/plugins/canvas/server/routes/shareables/zip.ts @@ -5,12 +5,12 @@ */ import archiver from 'archiver'; -import { API_ROUTE_SHAREABLE_ZIP } from '../../../../../legacy/plugins/canvas/common/lib'; +import { API_ROUTE_SHAREABLE_ZIP } from '../../../common/lib'; import { SHAREABLE_RUNTIME_FILE, SHAREABLE_RUNTIME_NAME, SHAREABLE_RUNTIME_SRC, -} from '../../../../../legacy/plugins/canvas/shareable_runtime/constants'; +} from '../../../shareable_runtime/constants'; import { RenderedWorkpadSchema } from './rendered_workpad_schema'; import { RouteInitializerDeps } from '..'; diff --git a/x-pack/plugins/canvas/server/routes/workpad/create.test.ts b/x-pack/plugins/canvas/server/routes/workpad/create.test.ts index dbad1a97dc4588..02b6376ece2eda 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/create.test.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/create.test.ts @@ -11,7 +11,7 @@ import { httpServerMock, loggingServiceMock, } from 'src/core/server/mocks'; -import { CANVAS_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../../common/lib/constants'; import { initializeCreateWorkpadRoute } from './create'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/workpad/create.ts b/x-pack/plugins/canvas/server/routes/workpad/create.ts index 1e9a320c0eeefe..5a693c05b3112a 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/create.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/create.ts @@ -5,12 +5,9 @@ */ import { RouteInitializerDeps } from '../'; -import { - CANVAS_TYPE, - API_ROUTE_WORKPAD, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; -import { CanvasWorkpad } from '../../../../../legacy/plugins/canvas/types'; -import { getId } from '../../../../../legacy/plugins/canvas/public/lib/get_id'; +import { CANVAS_TYPE, API_ROUTE_WORKPAD } from '../../../common/lib/constants'; +import { CanvasWorkpad } from '../../../types'; +import { getId } from '../../../common/lib/get_id'; import { WorkpadAttributes } from './workpad_attributes'; import { WorkpadSchema } from './workpad_schema'; import { okResponse } from '../ok_response'; diff --git a/x-pack/plugins/canvas/server/routes/workpad/delete.test.ts b/x-pack/plugins/canvas/server/routes/workpad/delete.test.ts index e693840826b7ab..57df4e7cffda61 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/delete.test.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/delete.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CANVAS_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../../common/lib/constants'; import { initializeDeleteWorkpadRoute } from './delete'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/workpad/delete.ts b/x-pack/plugins/canvas/server/routes/workpad/delete.ts index 8de4ea0f9a27f3..52c95c2f42d302 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/delete.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/delete.ts @@ -6,10 +6,7 @@ import { schema } from '@kbn/config-schema'; import { RouteInitializerDeps } from '../'; -import { - CANVAS_TYPE, - API_ROUTE_WORKPAD, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE, API_ROUTE_WORKPAD } from '../../../common/lib/constants'; import { okResponse } from '../ok_response'; import { catchErrorHandler } from '../catch_error_handler'; diff --git a/x-pack/plugins/canvas/server/routes/workpad/find.ts b/x-pack/plugins/canvas/server/routes/workpad/find.ts index a528a756116093..ec5c068a1fa24a 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/find.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/find.ts @@ -7,10 +7,7 @@ import { schema } from '@kbn/config-schema'; import { SavedObjectAttributes } from 'src/core/server'; import { RouteInitializerDeps } from '../'; -import { - CANVAS_TYPE, - API_ROUTE_WORKPAD, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE, API_ROUTE_WORKPAD } from '../../../common/lib/constants'; export function initializeFindWorkpadsRoute(deps: RouteInitializerDeps) { const { router } = deps; diff --git a/x-pack/plugins/canvas/server/routes/workpad/get.test.ts b/x-pack/plugins/canvas/server/routes/workpad/get.test.ts index a31293f572c75f..6741f2b3fc9d67 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/get.test.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/get.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CANVAS_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../../common/lib/constants'; import { initializeGetWorkpadRoute } from './get'; import { IRouter, @@ -18,8 +18,8 @@ import { httpServerMock, loggingServiceMock, } from 'src/core/server/mocks'; -import { workpadWithGroupAsElement } from '../../../../../legacy/plugins/canvas/__tests__/fixtures/workpads'; -import { CanvasWorkpad } from '../../../../../legacy/plugins/canvas/types'; +import { workpadWithGroupAsElement } from '../../../__tests__/fixtures/workpads'; +import { CanvasWorkpad } from '../../../types'; const mockRouteContext = ({ core: { diff --git a/x-pack/plugins/canvas/server/routes/workpad/get.ts b/x-pack/plugins/canvas/server/routes/workpad/get.ts index d7a5e77670f6e5..7dc1252063e902 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/get.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/get.ts @@ -6,10 +6,7 @@ import { schema } from '@kbn/config-schema'; import { RouteInitializerDeps } from '../'; -import { - CANVAS_TYPE, - API_ROUTE_WORKPAD, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE, API_ROUTE_WORKPAD } from '../../../common/lib/constants'; import { WorkpadAttributes } from './workpad_attributes'; import { catchErrorHandler } from '../catch_error_handler'; diff --git a/x-pack/plugins/canvas/server/routes/workpad/update.test.ts b/x-pack/plugins/canvas/server/routes/workpad/update.test.ts index de098dd9717ed0..a6b34e71651215 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/update.test.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/update.test.ts @@ -5,7 +5,7 @@ */ import sinon from 'sinon'; -import { CANVAS_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../../common/lib/constants'; import { initializeUpdateWorkpadRoute, initializeUpdateWorkpadAssetsRoute } from './update'; import { IRouter, @@ -19,7 +19,7 @@ import { httpServerMock, loggingServiceMock, } from 'src/core/server/mocks'; -import { workpads } from '../../../../../legacy/plugins/canvas/__tests__/fixtures/workpads'; +import { workpads } from '../../../__tests__/fixtures/workpads'; import { okResponse } from '../ok_response'; const mockRouteContext = ({ diff --git a/x-pack/plugins/canvas/server/routes/workpad/update.ts b/x-pack/plugins/canvas/server/routes/workpad/update.ts index 64736bcd57fd5d..021ac41d88d194 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/update.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/update.ts @@ -13,7 +13,7 @@ import { API_ROUTE_WORKPAD, API_ROUTE_WORKPAD_STRUCTURES, API_ROUTE_WORKPAD_ASSETS, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +} from '../../../common/lib/constants'; import { WorkpadAttributes } from './workpad_attributes'; import { WorkpadSchema, WorkpadAssetSchema } from './workpad_schema'; import { okResponse } from '../ok_response'; diff --git a/x-pack/plugins/canvas/server/routes/workpad/workpad_attributes.ts b/x-pack/plugins/canvas/server/routes/workpad/workpad_attributes.ts index 2b7b6cca4ba2bc..fd811adeebbd82 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/workpad_attributes.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/workpad_attributes.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { CanvasWorkpad } from '../../../../../legacy/plugins/canvas/types'; +import { CanvasWorkpad } from '../../../types'; export type WorkpadAttributes = Pick> & { '@timestamp': string; diff --git a/x-pack/plugins/canvas/server/saved_objects/custom_element.ts b/x-pack/plugins/canvas/server/saved_objects/custom_element.ts index d26f6dd8fb16e8..5fe48e98f28da1 100644 --- a/x-pack/plugins/canvas/server/saved_objects/custom_element.ts +++ b/x-pack/plugins/canvas/server/saved_objects/custom_element.ts @@ -5,7 +5,7 @@ */ import { SavedObjectsType } from 'src/core/server'; -import { CUSTOM_ELEMENT_TYPE } from '../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE } from '../../common/lib/constants'; export const customElementType: SavedObjectsType = { name: CUSTOM_ELEMENT_TYPE, diff --git a/x-pack/plugins/canvas/server/saved_objects/workpad.ts b/x-pack/plugins/canvas/server/saved_objects/workpad.ts index 2e9570b1b83be6..3c8486f3246b24 100644 --- a/x-pack/plugins/canvas/server/saved_objects/workpad.ts +++ b/x-pack/plugins/canvas/server/saved_objects/workpad.ts @@ -5,7 +5,7 @@ */ import { SavedObjectsType } from 'src/core/server'; -import { CANVAS_TYPE } from '../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../common/lib/constants'; import { removeAttributesId } from './migrations/remove_attributes_id'; export const workpadType: SavedObjectsType = { diff --git a/x-pack/plugins/canvas/server/setup_interpreter.ts b/x-pack/plugins/canvas/server/setup_interpreter.ts index 74dd8decbea697..79bc2f3c1996b7 100644 --- a/x-pack/plugins/canvas/server/setup_interpreter.ts +++ b/x-pack/plugins/canvas/server/setup_interpreter.ts @@ -5,7 +5,7 @@ */ import { ExpressionsServerSetup } from 'src/plugins/expressions/server'; -import { functions } from '../../../legacy/plugins/canvas/canvas_plugin_src/functions/server'; +import { functions } from '../canvas_plugin_src/functions/server'; export function setupInterpreter(expressions: ExpressionsServerSetup) { expressions.__LEGACY.register({ types: [], serverFunctions: functions }); diff --git a/x-pack/plugins/canvas/types/index.ts b/x-pack/plugins/canvas/types/index.ts index 21b3d2643c44c2..0799627ce9b5a1 100644 --- a/x-pack/plugins/canvas/types/index.ts +++ b/x-pack/plugins/canvas/types/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -export * from '../../../../../src/plugins/expressions/common'; +export * from '../../../../src/plugins/expressions/common'; export * from './assets'; export * from './canvas'; export * from './elements';