diff --git a/src/core/MIGRATION.md b/src/core/MIGRATION.md index f8699364fa9e2..d21be843a175c 100644 --- a/src/core/MIGRATION.md +++ b/src/core/MIGRATION.md @@ -1168,7 +1168,6 @@ import { setup, start } from '../core_plugins/visualizations/public/legacy'; | `import 'ui/query_bar'` | `import { QueryStringInput } from '../data/public'` | Directives are deprecated. | | `import 'ui/search_bar'` | `import { SearchBar } from '../data/public'` | Directive is deprecated. | | `import 'ui/kbn_top_nav'` | `import { TopNavMenu } from '../navigation/public'` | Directive is still available in `ui/kbn_top_nav`. | -| `ui/saved_objects/components/saved_object_finder` | `import { SavedObjectFinder } from '../kibana_react/public'` | | | `core_plugins/interpreter` | `data.expressions` | still in progress | | `ui/courier` | `data.search` | still in progress | | `ui/embeddable` | `embeddables` | still in progress | diff --git a/src/core/public/index.scss b/src/core/public/index.scss index 86f2efdff7702..4c3f8eeb4393c 100644 --- a/src/core/public/index.scss +++ b/src/core/public/index.scss @@ -9,3 +9,4 @@ @import './chrome/index'; @import './overlays/index'; +@import './saved_objects/index'; diff --git a/src/core/public/index.ts b/src/core/public/index.ts index 6d756e36d7379..563f05ec8a208 100644 --- a/src/core/public/index.ts +++ b/src/core/public/index.ts @@ -137,6 +137,15 @@ export { SavedObjectsImportUnknownError, SavedObjectsImportError, SavedObjectsImportRetry, + showSaveModal, + SaveResult, + MinimalSaveModalProps, + SavedObjectSaveModal, + OnSaveProps, + SavedObjectMetaData, + SavedObjectFinderProps, + SavedObjectFinder, + SavedObjectFinderUi, } from './saved_objects'; export { diff --git a/src/plugins/kibana_react/public/saved_objects/_index.scss b/src/core/public/saved_objects/_index.scss similarity index 100% rename from src/plugins/kibana_react/public/saved_objects/_index.scss rename to src/core/public/saved_objects/_index.scss diff --git a/src/core/public/saved_objects/index.ts b/src/core/public/saved_objects/index.ts index 5015a9c3db78e..8be1b16a8aa09 100644 --- a/src/core/public/saved_objects/index.ts +++ b/src/core/public/saved_objects/index.ts @@ -31,6 +31,14 @@ export { } from './saved_objects_client'; export { SimpleSavedObject } from './simple_saved_object'; export { SavedObjectsStart, SavedObjectsService } from './saved_objects_service'; +export { showSaveModal, SaveResult, MinimalSaveModalProps } from './show_saved_object_save_modal'; +export { SavedObjectSaveModal, OnSaveProps } from './saved_object_save_modal'; +export { + SavedObjectMetaData, + SavedObjectFinderProps, + SavedObjectFinder, + SavedObjectFinderUi, +} from './saved_object_finder'; export { SavedObject, SavedObjectAttribute, diff --git a/src/plugins/kibana_react/public/saved_objects/saved_object_finder.test.tsx b/src/core/public/saved_objects/saved_object_finder.test.tsx similarity index 99% rename from src/plugins/kibana_react/public/saved_objects/saved_object_finder.test.tsx rename to src/core/public/saved_objects/saved_object_finder.test.tsx index 58b396d57639b..bc57da1995ce3 100644 --- a/src/plugins/kibana_react/public/saved_objects/saved_object_finder.test.tsx +++ b/src/core/public/saved_objects/saved_object_finder.test.tsx @@ -37,7 +37,7 @@ import React from 'react'; import * as sinon from 'sinon'; import { SavedObjectFinderUi as SavedObjectFinder } from './saved_object_finder'; // eslint-disable-next-line -import { coreMock } from '../../../../core/public/mocks'; +import { coreMock } from '../mocks'; describe('SavedObjectsFinder', () => { const doc = { diff --git a/src/plugins/kibana_react/public/saved_objects/saved_object_finder.tsx b/src/core/public/saved_objects/saved_object_finder.tsx similarity index 98% rename from src/plugins/kibana_react/public/saved_objects/saved_object_finder.tsx rename to src/core/public/saved_objects/saved_object_finder.tsx index 2a43f29024ba7..c47447d951326 100644 --- a/src/plugins/kibana_react/public/saved_objects/saved_object_finder.tsx +++ b/src/core/public/saved_objects/saved_object_finder.tsx @@ -44,9 +44,9 @@ import { import { Direction } from '@elastic/eui/src/services/sort/sort_direction'; import { i18n } from '@kbn/i18n'; -import { SavedObjectAttributes } from '../../../../core/public'; -import { SimpleSavedObject, CoreStart } from '../../../../core/public'; -import { useKibana } from '../context'; +import { SavedObjectAttributes } from '.'; +import { SimpleSavedObject, CoreStart } from '../'; +import { useKibana } from '../../../plugins/kibana_react/public'; // eslint-disable-line @kbn/eslint/no-restricted-paths // TODO the typings for EuiListGroup are incorrect - maxWidth is missing. This can be removed when the types are adjusted const FixedEuiListGroup = (EuiListGroup as any) as React.FunctionComponent< @@ -108,7 +108,7 @@ interface SavedObjectFinderInitialPageSize extends BaseSavedObjectFinder { export type SavedObjectFinderProps = SavedObjectFinderFixedPage | SavedObjectFinderInitialPageSize; -export type SavedObjectFinderUiProps = { +type SavedObjectFinderUiProps = { savedObjects: CoreStart['savedObjects']; uiSettings: CoreStart['uiSettings']; } & SavedObjectFinderProps; diff --git a/src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.scss b/src/core/public/saved_objects/saved_object_save_modal.scss similarity index 100% rename from src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.scss rename to src/core/public/saved_objects/saved_object_save_modal.scss diff --git a/src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.test.tsx b/src/core/public/saved_objects/saved_object_save_modal.test.tsx similarity index 100% rename from src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.test.tsx rename to src/core/public/saved_objects/saved_object_save_modal.test.tsx diff --git a/src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.tsx b/src/core/public/saved_objects/saved_object_save_modal.tsx similarity index 97% rename from src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.tsx rename to src/core/public/saved_objects/saved_object_save_modal.tsx index cdbc2bb9b5473..3e15ae7fe04d1 100644 --- a/src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.tsx +++ b/src/core/public/saved_objects/saved_object_save_modal.tsx @@ -35,11 +35,11 @@ import { EuiSwitchEvent, EuiTextArea, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n/target/types/react'; import React from 'react'; import { EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../legacy/core_plugins/visualizations/public/embeddable/constants'; +import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../legacy/core_plugins/visualizations/public/embeddable/constants'; // eslint-disable-line @kbn/eslint/no-restricted-paths export interface OnSaveProps { newTitle: string; diff --git a/src/legacy/ui/public/saved_objects/show_saved_object_save_modal.tsx b/src/core/public/saved_objects/show_saved_object_save_modal.tsx similarity index 96% rename from src/legacy/ui/public/saved_objects/show_saved_object_save_modal.tsx rename to src/core/public/saved_objects/show_saved_object_save_modal.tsx index 3c691c692948a..d9ca99fd44e9b 100644 --- a/src/legacy/ui/public/saved_objects/show_saved_object_save_modal.tsx +++ b/src/core/public/saved_objects/show_saved_object_save_modal.tsx @@ -19,7 +19,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { I18nContext } from 'ui/i18n'; +import { npStart } from 'ui/new_platform'; /** * Represents the result of trying to persist the saved object. @@ -62,5 +62,6 @@ export function showSaveModal(saveModal: React.ReactElement{element}, container); } diff --git a/src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts b/src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts index 97d165b6b5c23..a0efb166c3203 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts @@ -30,11 +30,9 @@ export const legacyChrome = chrome; export { SavedObjectSaveOpts } from 'ui/saved_objects/types'; export { npSetup, npStart } from 'ui/new_platform'; export { IPrivate } from 'ui/private'; -export { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_save_modal'; export { subscribeWithScope } from 'ui/utils/subscribe_with_scope'; // @ts-ignore export { ConfirmationButtonTypes } from 'ui/modals/confirm_modal'; -export { showSaveModal, SaveResult } from 'ui/saved_objects/show_saved_object_save_modal'; export { migrateLegacyQuery } from 'ui/utils/migrate_legacy_query'; export { KbnUrl } from 'ui/url/kbn_url'; // @ts-ignore diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx index e85054cd7fb34..5bd3736c763f7 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx @@ -24,14 +24,18 @@ import angular from 'angular'; import { Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; +import { + SaveResult, + showSaveModal, + SavedObjectFinderProps, + SavedObjectFinderUi, +} from '../../../../../../core/public'; import { DashboardEmptyScreen, DashboardEmptyScreenProps } from './dashboard_empty_screen'; import { ConfirmationButtonTypes, migrateLegacyQuery, SavedObjectSaveOpts, - SaveResult, - showSaveModal, subscribeWithScope, } from '../legacy_imports'; import { @@ -73,10 +77,6 @@ import { getDashboardTitle } from './dashboard_strings'; import { DashboardAppScope } from './dashboard_app'; import { convertSavedDashboardPanelToPanelState } from './lib/embeddable_saved_object_converters'; import { RenderDeps } from './application'; -import { - SavedObjectFinderProps, - SavedObjectFinderUi, -} from '../../../../../../plugins/kibana_react/public'; import { removeQueryParam, unhashUrl } from '../../../../../../plugins/kibana_utils/public'; export interface DashboardAppControllerDependencies extends RenderDeps { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.test.js b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.test.js index 5f708a22fd530..ca1efaf22ac31 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.test.js +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.test.js @@ -20,7 +20,7 @@ import React from 'react'; import { shallowWithI18nProvider } from 'test_utils/enzyme_helpers'; -jest.mock('../../legacy_imports', () => ({ +jest.mock('../../../../../../../core/public', () => ({ SavedObjectSaveModal: () => null, })); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.tsx b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.tsx index bd53fd5a13083..31e7e134d1935 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.tsx @@ -21,7 +21,7 @@ import React, { Fragment } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiFormRow, EuiTextArea, EuiSwitch } from '@elastic/eui'; -import { SavedObjectSaveModal } from '../../legacy_imports'; +import { SavedObjectSaveModal } from '../../../../../../../core/public'; interface SaveOptions { newTitle: string; diff --git a/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts b/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts index 58406c74e9f38..8e05af64a4f92 100644 --- a/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts +++ b/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts @@ -62,8 +62,6 @@ export { getRequestInspectorStats, getResponseInspectorStats } from '../../../da export { intervalOptions } from 'ui/agg_types/buckets/_interval_options'; // @ts-ignore export { migrateLegacyQuery } from 'ui/utils/migrate_legacy_query'; -export { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_save_modal'; -export { showSaveModal } from 'ui/saved_objects/show_saved_object_save_modal'; export { stateMonitorFactory } from 'ui/state_management/state_monitor_factory'; export { subscribeWithScope } from 'ui/utils/subscribe_with_scope'; // @ts-ignore diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js index 3f3333b7caec2..2cb4fabd51c1d 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js @@ -25,6 +25,7 @@ import dateMath from '@elastic/datemath'; import { i18n } from '@kbn/i18n'; import '../components/field_chooser/field_chooser'; +import { showSaveModal, SavedObjectSaveModal } from '../../../../../../../core/public'; import { RequestAdapter } from '../../../../../../../plugins/inspector/public'; // doc table import './doc_table'; @@ -47,13 +48,11 @@ import { hasSearchStategyForIndexPattern, intervalOptions, migrateLegacyQuery, - showSaveModal, unhashUrl, stateMonitorFactory, subscribeWithScope, tabifyAggResponse, Vis, - SavedObjectSaveModal, getAngularModule, ensureDefaultIndexPattern, registerTimefilterWithGlobalStateFactory, diff --git a/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts b/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts index e5165cac5c11e..d33108be8ca86 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts @@ -44,9 +44,6 @@ export { IPrivate } from 'ui/private'; // @ts-ignore export { PrivateProvider } from 'ui/private/private'; -export { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_save_modal'; -export { showSaveModal } from 'ui/saved_objects/show_saved_object_save_modal'; - export { subscribeWithScope } from 'ui/utils/subscribe_with_scope'; export { migrateLegacyQuery } from 'ui/utils/migrate_legacy_query'; // @ts-ignore diff --git a/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.js b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.js index 2a4fdeb4e4016..aafb10154fdd1 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.js +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.js @@ -31,6 +31,7 @@ import { getEditBreadcrumbs } from '../breadcrumbs'; import { addHelpMenuToAppChrome } from '../help_menu/help_menu_util'; import { FilterStateManager } from '../../../../../data/public'; import { unhashUrl } from '../../../../../../../plugins/kibana_utils/public'; +import { showSaveModal, SavedObjectSaveModal } from '../../../../../../../core/public'; import { initVisEditorDirective } from './visualization_editor'; import { initVisualizationDirective } from './visualization'; @@ -40,8 +41,6 @@ import { absoluteToParsedUrl, KibanaParsedUrl, migrateLegacyQuery, - SavedObjectSaveModal, - showSaveModal, stateMonitorFactory, DashboardConstants, } from '../../legacy_imports'; diff --git a/src/legacy/ui/public/saved_objects/components/saved_object_save_modal.tsx b/src/legacy/ui/public/saved_objects/components/saved_object_save_modal.tsx deleted file mode 100644 index 131f28059cebd..0000000000000 --- a/src/legacy/ui/public/saved_objects/components/saved_object_save_modal.tsx +++ /dev/null @@ -1,25 +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. - */ - -/** - * @deprecated - * - * Do not import this component from here. Import from `src/plugins/kibana_react` instead. - */ -export { SavedObjectSaveModal } from '../../../../../plugins/kibana_react/public'; diff --git a/src/plugins/dashboard_embeddable_container/public/embeddable/dashboard_container_factory.tsx b/src/plugins/dashboard_embeddable_container/public/embeddable/dashboard_container_factory.tsx index c8a2837fd77d0..2c8fba893ecf2 100644 --- a/src/plugins/dashboard_embeddable_container/public/embeddable/dashboard_container_factory.tsx +++ b/src/plugins/dashboard_embeddable_container/public/embeddable/dashboard_container_factory.tsx @@ -18,8 +18,7 @@ */ import { i18n } from '@kbn/i18n'; -import { SavedObjectAttributes } from '../../../../core/public'; -import { SavedObjectMetaData } from '../types'; +import { SavedObjectAttributes, SavedObjectMetaData } from '../../../../core/public'; import { ContainerOutput, EmbeddableFactory, diff --git a/src/plugins/dashboard_embeddable_container/public/plugin.tsx b/src/plugins/dashboard_embeddable_container/public/plugin.tsx index d18fbba239ec0..eeb150965acaf 100644 --- a/src/plugins/dashboard_embeddable_container/public/plugin.tsx +++ b/src/plugins/dashboard_embeddable_container/public/plugin.tsx @@ -20,15 +20,20 @@ /* eslint-disable max-classes-per-file */ import * as React from 'react'; -import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core/public'; +import { + PluginInitializerContext, + CoreSetup, + CoreStart, + Plugin, + SavedObjectFinderUi, + SavedObjectFinderProps, +} from '../../../core/public'; import { IUiActionsSetup, IUiActionsStart } from '../../../plugins/ui_actions/public'; import { CONTEXT_MENU_TRIGGER, IEmbeddableSetup, IEmbeddableStart } from './embeddable_plugin'; import { ExpandPanelAction, ReplacePanelAction } from '.'; import { DashboardContainerFactory } from './embeddable/dashboard_container_factory'; import { Start as InspectorStartContract } from '../../../plugins/inspector/public'; import { - SavedObjectFinderUi, - SavedObjectFinderProps, ExitFullScreenButton as ExitFullScreenButtonUi, ExitFullScreenButtonProps, } from '../../../plugins/kibana_react/public'; diff --git a/src/plugins/dashboard_embeddable_container/public/types.ts b/src/plugins/dashboard_embeddable_container/public/types.ts index 9c2d6c0ab388d..895f61b617d2e 100644 --- a/src/plugins/dashboard_embeddable_container/public/types.ts +++ b/src/plugins/dashboard_embeddable_container/public/types.ts @@ -50,14 +50,6 @@ export interface SimpleSavedObject { delete(): void; } -export interface SavedObjectMetaData { - type: string; - name: string; - getIconForSavedObject(savedObject: SimpleSavedObject): IconType; - getTooltipForSavedObject?(savedObject: SimpleSavedObject): string; - showSavedObject?(savedObject: SimpleSavedObject): boolean; -} - interface FieldSubType { multi?: { parent: string }; nested?: { path: string }; diff --git a/src/plugins/embeddable/public/index.ts b/src/plugins/embeddable/public/index.ts index 583b21ddfa433..21bc45c6c0312 100644 --- a/src/plugins/embeddable/public/index.ts +++ b/src/plugins/embeddable/public/index.ts @@ -51,7 +51,6 @@ export { PanelNotFoundError, PanelState, PropertySpec, - SavedObjectMetaData, ViewMode, isErrorEmbeddable, openAddPanelFlyout, diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts b/src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts index acc2da1514483..cec0d1875d040 100644 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts +++ b/src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts @@ -17,8 +17,7 @@ * under the License. */ -import { SavedObjectAttributes } from 'src/core/public'; -import { SavedObjectMetaData } from '../types'; +import { SavedObjectAttributes, SavedObjectMetaData } from 'src/core/public'; import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from './i_embeddable'; import { ErrorEmbeddable } from './error_embeddable'; import { IContainer } from '../containers/i_container'; diff --git a/src/plugins/embeddable/public/lib/types.ts b/src/plugins/embeddable/public/lib/types.ts index 5fc01a62351c0..1bd71163db44c 100644 --- a/src/plugins/embeddable/public/lib/types.ts +++ b/src/plugins/embeddable/public/lib/types.ts @@ -42,16 +42,5 @@ export enum ViewMode { export { Adapters }; -// import { SavedObjectMetaData } from 'ui/saved_objects/components/saved_object_finder'; -// TODO: Figure out how to do this import in New Platform. -export interface SavedObjectMetaData { - type: string; - name: string; - getIconForSavedObject(savedObject: any): any; - getTooltipForSavedObject?(savedObject: any): any; - showSavedObject?(savedObject: any): boolean; - includeFields?: string[]; -} - export type GetEmbeddableFactory = (id: string) => EmbeddableFactory | undefined; export type GetEmbeddableFactories = () => IterableIterator; diff --git a/src/plugins/kibana_react/public/index.ts b/src/plugins/kibana_react/public/index.ts index 81f2e694e8e5b..1108da1f778b7 100644 --- a/src/plugins/kibana_react/public/index.ts +++ b/src/plugins/kibana_react/public/index.ts @@ -18,7 +18,6 @@ */ export * from './code_editor'; -export * from './saved_objects'; export * from './exit_full_screen_button'; export * from './context'; export * from './overlays'; diff --git a/src/plugins/kibana_react/public/saved_objects/__snapshots__/saved_object_save_modal.test.tsx.snap b/src/plugins/kibana_react/public/saved_objects/__snapshots__/saved_object_save_modal.test.tsx.snap deleted file mode 100644 index 18f84f41d5d99..0000000000000 --- a/src/plugins/kibana_react/public/saved_objects/__snapshots__/saved_object_save_modal.test.tsx.snap +++ /dev/null @@ -1,100 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`SavedObjectSaveModal should render matching snapshot 1`] = ` - -
- - - - - - - - - - } - labelType="label" - > - - - - } - labelType="label" - > - - - - - - - - - - Save - - - -
-
-`; diff --git a/src/plugins/kibana_react/public/saved_objects/index.ts b/src/plugins/kibana_react/public/saved_objects/index.ts deleted file mode 100644 index ade80d2cd2a92..0000000000000 --- a/src/plugins/kibana_react/public/saved_objects/index.ts +++ /dev/null @@ -1,21 +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. - */ - -export * from './saved_object_finder'; -export * from './saved_object_save_modal'; 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 8f22e54bac3c1..64400566b437a 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 @@ -18,7 +18,13 @@ */ import React from 'react'; import ReactDOM from 'react-dom'; -import { CoreSetup, CoreStart, Plugin } from 'src/core/public'; +import { + CoreSetup, + CoreStart, + Plugin, + SavedObjectFinderProps, + SavedObjectFinderUi, +} from 'src/core/public'; import { IUiActionsStart } from '../../../../../../../src/plugins/ui_actions/public'; import { createHelloWorldAction } from '../../../../../../../src/plugins/ui_actions/public/tests/test_samples'; @@ -37,10 +43,6 @@ import { ContactCardEmbeddableFactory, } from './embeddable_api'; import { App } from './app'; -import { - SavedObjectFinderProps, - SavedObjectFinderUi, -} from '../../../../../../../src/plugins/kibana_react/public/saved_objects'; import { HelloWorldEmbeddableFactory } from '../../../../../../../examples/embeddable_examples/public'; import { IEmbeddableStart, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx b/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx index 8642ebd901bb4..94de87c27b7ec 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx @@ -17,10 +17,7 @@ import { import { start } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; import { EmbeddableExpression } from '../../expression_types/embeddable'; import { RendererStrings } from '../../../i18n'; -import { - SavedObjectFinderProps, - SavedObjectFinderUi, -} from '../../../../../../../src/plugins/kibana_react/public'; +import { SavedObjectFinderProps, SavedObjectFinderUi } from '../../../../../../../src/core/public'; const { embeddable: strings } = RendererStrings; import { embeddableInputToExpression } from './embeddable_input_to_expression'; 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 786403f2748fa..78af478085fd6 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 @@ -7,13 +7,13 @@ import React from 'react'; import { EuiFlyout, EuiFlyoutHeader, EuiFlyoutBody, EuiTitle } from '@elastic/eui'; +import { start } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; +import { ComponentStrings } from '../../../i18n'; import { + CoreStart, SavedObjectFinderUi, SavedObjectMetaData, -} from '../../../../../../../src/plugins/kibana_react/public/saved_objects'; // eslint-disable-line -import { start } from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; -import { ComponentStrings } from '../../../i18n'; -import { CoreStart } from '../../../../../../../src/core/public'; +} from '../../../../../../../src/core/public'; const { AddEmbeddableFlyout: strings } = ComponentStrings; diff --git a/x-pack/legacy/plugins/graph/public/app.js b/x-pack/legacy/plugins/graph/public/app.js index d0dbf34abc055..37ceee2445629 100644 --- a/x-pack/legacy/plugins/graph/public/app.js +++ b/x-pack/legacy/plugins/graph/public/app.js @@ -12,7 +12,7 @@ import { Provider } from 'react-redux'; import { isColorDark, hexToRgb } from '@elastic/eui'; import { toMountPoint } from '../../../../../src/plugins/kibana_react/public'; -import { showSaveModal } from './legacy_imports'; +import { showSaveModal } from '../../../../../src/core/public'; import appTemplate from './angular/templates/index.html'; import listingTemplate from './angular/templates/listing_ng_wrapper.html'; @@ -276,7 +276,6 @@ export function initGraphApp(angularModule, deps) { }, notifications: coreStart.notifications, http: coreStart.http, - showSaveModal, setWorkspaceInitialized: () => { $scope.workspaceInitialized = true; }, diff --git a/x-pack/legacy/plugins/graph/public/components/save_modal.tsx b/x-pack/legacy/plugins/graph/public/components/save_modal.tsx index b60a444453f7d..56383409078a6 100644 --- a/x-pack/legacy/plugins/graph/public/components/save_modal.tsx +++ b/x-pack/legacy/plugins/graph/public/components/save_modal.tsx @@ -7,10 +7,7 @@ import React, { useState } from 'react'; import { EuiFormRow, EuiTextArea, EuiCallOut, EuiSpacer, EuiSwitch } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { - SavedObjectSaveModal, - OnSaveProps, -} from '../../../../../../src/plugins/kibana_react/public'; +import { SavedObjectSaveModal, OnSaveProps } from '../../../../../../src/core/public'; import { GraphSavePolicy } from '../types/config'; diff --git a/x-pack/legacy/plugins/graph/public/legacy_imports.ts b/x-pack/legacy/plugins/graph/public/legacy_imports.ts index 7ea2cf6dd901b..702c6cb2d4542 100644 --- a/x-pack/legacy/plugins/graph/public/legacy_imports.ts +++ b/x-pack/legacy/plugins/graph/public/legacy_imports.ts @@ -15,6 +15,4 @@ export { createTopNavDirective, createTopNavHelper } from 'ui/kbn_top_nav/kbn_to export { confirmModalFactory } from 'ui/modals/confirm_modal'; // @ts-ignore export { addAppRedirectMessageToUrl } from 'ui/notify'; -export { SaveResult } from 'ui/saved_objects/show_saved_object_save_modal'; export { createSavedObjectClass } from 'ui/saved_objects/saved_object'; -export { showSaveModal } from 'ui/saved_objects/show_saved_object_save_modal'; diff --git a/x-pack/legacy/plugins/graph/public/services/save_modal.tsx b/x-pack/legacy/plugins/graph/public/services/save_modal.tsx index d949ac1d4a600..cabb20941ca1d 100644 --- a/x-pack/legacy/plugins/graph/public/services/save_modal.tsx +++ b/x-pack/legacy/plugins/graph/public/services/save_modal.tsx @@ -5,9 +5,9 @@ */ import React from 'react'; +import { showSaveModal, SaveResult } from '../../../../../../src/core/public'; import { GraphWorkspaceSavedObject, GraphSavePolicy } from '../types'; import { SaveModal, OnSaveGraphProps } from '../components/save_modal'; -import { SaveResult } from '../legacy_imports'; export type SaveWorkspaceHandler = ( saveOptions: { @@ -23,13 +23,11 @@ export function openSaveModal({ hasData, workspace, saveWorkspace, - showSaveModal, }: { savePolicy: GraphSavePolicy; hasData: boolean; workspace: GraphWorkspaceSavedObject; saveWorkspace: SaveWorkspaceHandler; - showSaveModal: (el: React.ReactNode) => void; }) { const currentTitle = workspace.title; const currentDescription = workspace.description; diff --git a/x-pack/legacy/plugins/graph/public/state_management/mocks.ts b/x-pack/legacy/plugins/graph/public/state_management/mocks.ts index 5a4f0d033aa42..518569fc23091 100644 --- a/x-pack/legacy/plugins/graph/public/state_management/mocks.ts +++ b/x-pack/legacy/plugins/graph/public/state_management/mocks.ts @@ -72,7 +72,6 @@ export function createMockGraphStore({ http: {} as HttpStart, notifyAngular: jest.fn(), savePolicy: 'configAndData', - showSaveModal: jest.fn(), setLiveResponseFields: jest.fn(), setUrlTemplates: jest.fn(), setWorkspaceInitialized: jest.fn(), diff --git a/x-pack/legacy/plugins/graph/public/state_management/persistence.ts b/x-pack/legacy/plugins/graph/public/state_management/persistence.ts index 0bc7827358b81..a7d8a2ca23d11 100644 --- a/x-pack/legacy/plugins/graph/public/state_management/persistence.ts +++ b/x-pack/legacy/plugins/graph/public/state_management/persistence.ts @@ -197,7 +197,6 @@ function showModal( savePolicy: deps.savePolicy, hasData: workspace.nodes.length > 0 || workspace.blacklistedNodes.length > 0, workspace: savedWorkspace, - showSaveModal: deps.showSaveModal, saveWorkspace: saveWorkspaceHandler, }); } diff --git a/x-pack/legacy/plugins/graph/public/state_management/store.ts b/x-pack/legacy/plugins/graph/public/state_management/store.ts index bb01f20196f87..4ae0a375dbce2 100644 --- a/x-pack/legacy/plugins/graph/public/state_management/store.ts +++ b/x-pack/legacy/plugins/graph/public/state_management/store.ts @@ -54,7 +54,6 @@ export interface GraphStoreDependencies { getSavedWorkspace: () => GraphWorkspaceSavedObject; notifications: CoreStart['notifications']; http: CoreStart['http']; - showSaveModal: (el: React.ReactNode) => void; savePolicy: GraphSavePolicy; changeUrl: (newUrl: string) => void; notifyAngular: () => void; diff --git a/x-pack/legacy/plugins/lens/public/app_plugin/app.tsx b/x-pack/legacy/plugins/lens/public/app_plugin/app.tsx index 35e45af6a3d68..0bc8a82c4a96c 100644 --- a/x-pack/legacy/plugins/lens/public/app_plugin/app.tsx +++ b/x-pack/legacy/plugins/lens/public/app_plugin/app.tsx @@ -9,12 +9,11 @@ import React, { useState, useEffect, useCallback } from 'react'; import { I18nProvider } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; import { Query, DataPublicPluginStart } from 'src/plugins/data/public'; -import { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_save_modal'; import { AppMountContext, NotificationsStart } from 'src/core/public'; import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import { npStart } from 'ui/new_platform'; import { FormattedMessage } from '@kbn/i18n/react'; -import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; +import { KibanaContextProvider, SavedObjectSaveModal } from '../../../../../../src/core/public'; import { Document, SavedObjectStore } from '../persistence'; import { EditorFrameInstance } from '../types'; import { NativeRenderer } from '../native_renderer'; diff --git a/x-pack/legacy/plugins/maps/public/angular/map_controller.js b/x-pack/legacy/plugins/maps/public/angular/map_controller.js index 5f058e2ba7806..d700bda840554 100644 --- a/x-pack/legacy/plugins/maps/public/angular/map_controller.js +++ b/x-pack/legacy/plugins/maps/public/angular/map_controller.js @@ -45,8 +45,6 @@ import { import { getInspectorAdapters } from '../reducers/non_serializable_instances'; import { docTitle } from 'ui/doc_title'; import { indexPatternService, getInspector } from '../kibana_services'; -import { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_save_modal'; -import { showSaveModal } from 'ui/saved_objects/show_saved_object_save_modal'; import { toastNotifications } from 'ui/notify'; import { getInitialLayers } from './get_initial_layers'; import { getInitialQuery } from './get_initial_query'; @@ -55,6 +53,7 @@ import { getInitialRefreshConfig } from './get_initial_refresh_config'; import { MAP_SAVED_OBJECT_TYPE, MAP_APP_PATH } from '../../common/constants'; import { npStart } from 'ui/new_platform'; import { esFilters } from '../../../../../../src/plugins/data/public'; +import { showSaveModal, SavedObjectSaveModal } from '../../../../../../src/core/public'; const savedQueryService = npStart.plugins.data.query.savedQueries; 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 cbbb4f8c6249e..305e8061e73bc 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 @@ -25,10 +25,7 @@ import * as i18n from './translations'; import { MapEmbeddable, SetQuery } from './types'; import { Query, esFilters } from '../../../../../../../src/plugins/data/public'; import { useKibana, useUiSetting$ } from '../../lib/kibana'; -import { - SavedObjectFinderProps, - SavedObjectFinderUi, -} from '../../../../../../../src/plugins/kibana_react/public'; +import { SavedObjectFinder } from '../../../../../../../src/core/public'; interface EmbeddableMapProps { maintainRatio?: boolean; @@ -177,14 +174,6 @@ export const EmbeddedMapComponent = ({ } }, [startDate, endDate]); - const SavedObjectFinder = (props: SavedObjectFinderProps) => ( - - ); - return isError ? null : (