diff --git a/src/legacy/core_plugins/kibana/public/.eslintrc b/src/legacy/core_plugins/kibana/public/.eslintrc deleted file mode 100644 index cc44af915ba25..0000000000000 --- a/src/legacy/core_plugins/kibana/public/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -rules: - no-console: 2 - 'import/no-default-export': error diff --git a/src/legacy/core_plugins/kibana/public/.eslintrc.js b/src/legacy/core_plugins/kibana/public/.eslintrc.js new file mode 100644 index 0000000000000..160adcc5b63f1 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/.eslintrc.js @@ -0,0 +1,72 @@ +/* + * 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. + */ + +const path = require('path'); + +/** + * Builds custom restricted paths configuration for the shimmed plugins within the kibana plugin. + * These custom rules extend the default checks in the top level `eslintrc.js` by also checking two other things: + * * Making sure nothing within np_ready imports from the `ui` directory + * * Making sure no other code is importing things deep from within the shimmed plugins + * @param shimmedPlugins List of plugin names within the kibana plugin that are partially np ready + * @returns zones configuration for the no-restricted-paths linter + */ +function buildRestrictedPaths(shimmedPlugins) { + return shimmedPlugins.map(shimmedPlugin => ([{ + target: [ + `src/legacy/core_plugins/kibana/public/${shimmedPlugin}/np_ready/**/*`, + ], + from: [ + 'ui/**/*', + 'src/legacy/ui/**/*', + 'src/legacy/core_plugins/kibana/public/**/*', + 'src/legacy/core_plugins/data/public/**/*', + '!src/legacy/core_plugins/data/public/index.ts', + `!src/legacy/core_plugins/kibana/public/${shimmedPlugin}/**/*`, + ], + allowSameFolder: false, + errorMessage: `${shimmedPlugin} is a shimmed plugin that is not allowed to import modules from the legacy platform. If you need legacy modules for the transition period, import them either in the legacy_imports, kibana_services or index module.`, + }, { + target: [ + 'src/**/*', + `!src/legacy/core_plugins/kibana/public/${shimmedPlugin}/**/*`, + 'x-pack/**/*', + ], + from: [ + `src/legacy/core_plugins/kibana/public/${shimmedPlugin}/**/*`, + `!src/legacy/core_plugins/kibana/public/${shimmedPlugin}/index.ts`, + ], + allowSameFolder: false, + errorMessage: `kibana/public/${shimmedPlugin} is behaving like a NP plugin and does not allow deep imports. If you need something from within ${shimmedPlugin} in another plugin, consider re-exporting it from the top level index module`, + }])).reduce((acc, part) => [...acc, ...part], []); +} + +module.exports = { + rules: { + 'no-console': 2, + 'import/no-default-export': 'error', + '@kbn/eslint/no-restricted-paths': [ + 'error', + { + basePath: path.resolve(__dirname, '../../../../../'), + zones: buildRestrictedPaths(['visualize', 'discover', 'dashboard', 'devTools', 'home']), + }, + ], + }, +}; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/__tests__/dashboard_empty_screen.test.tsx b/src/legacy/core_plugins/kibana/public/dashboard/__tests__/dashboard_empty_screen.test.tsx index 653e7d4215eef..1c450879ee553 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/__tests__/dashboard_empty_screen.test.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/__tests__/dashboard_empty_screen.test.tsx @@ -18,7 +18,10 @@ */ import React from 'react'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; -import { DashboardEmptyScreen, DashboardEmptyScreenProps } from '../dashboard_empty_screen'; +import { + DashboardEmptyScreen, + DashboardEmptyScreenProps, +} from '../np_ready/dashboard_empty_screen'; // @ts-ignore import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/__tests__/get_saved_dashboard_mock.ts b/src/legacy/core_plugins/kibana/public/dashboard/__tests__/get_saved_dashboard_mock.ts index bf7135098ea74..1c2405b5824f2 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/__tests__/get_saved_dashboard_mock.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/__tests__/get_saved_dashboard_mock.ts @@ -17,7 +17,7 @@ * under the License. */ -import { searchSourceMock } from '../../../../../ui/public/courier/search_source/mocks'; +import { searchSourceMock } from 'ui/courier/search_source/mocks'; import { SavedObjectDashboard } from '../saved_dashboard/saved_dashboard'; export function getSavedDashboardMock( diff --git a/src/legacy/core_plugins/kibana/public/dashboard/index.ts b/src/legacy/core_plugins/kibana/public/dashboard/index.ts index dccc4c11e334f..76d9933a3d567 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/index.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/index.ts @@ -30,6 +30,8 @@ import { start as embeddables } from '../../../embeddable_api/public/np_ready/pu import './saved_dashboard/saved_dashboards'; import './dashboard_config'; +export * from './np_ready/dashboard_constants'; + /** * Get dependencies relying on the global angular context. * They also have to get resolved together with the legacy imports above 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 adae063a1470b..d3c17d1176c10 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts @@ -57,7 +57,7 @@ export { createTopNavDirective, createTopNavHelper } from 'ui/kbn_top_nav/kbn_to // @ts-ignore export { PromiseServiceCreator } from 'ui/promises/promises'; // @ts-ignore -export { KbnUrlProvider, RedirectWhenMissingProvider } from 'ui/url'; +export { KbnUrlProvider, RedirectWhenMissingProvider } from 'ui/url/index'; // @ts-ignore export { confirmModalFactory } from 'ui/modals/confirm_modal'; export { configureAppAngularModule } from 'ui/legacy_compat'; @@ -65,3 +65,5 @@ export { stateMonitorFactory, StateMonitor } from 'ui/state_management/state_mon export { ensureDefaultIndexPattern } from 'ui/legacy_compat'; export { unhashUrl } from '../../../../../plugins/kibana_utils/public'; export { IInjector } from 'ui/chrome'; +export { VISUALIZE_EMBEDDABLE_TYPE } from '../visualize_embeddable'; +export { registerTimefilterWithGlobalStateFactory } from 'ui/timefilter/setup_router'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.test.ts b/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.test.ts index 09677f149c064..ad4feacde0815 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.test.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.test.ts @@ -37,7 +37,7 @@ jest.mock( jest.mock('ui/new_platform'); import { migratePanelsTo730 } from './migrate_to_730_panels'; -import { SavedDashboardPanelTo60, SavedDashboardPanel730ToLatest } from '../types'; +import { SavedDashboardPanelTo60, SavedDashboardPanel730ToLatest } from '../np_ready/types'; import { RawSavedDashboardPanelTo60, RawSavedDashboardPanel610, diff --git a/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.ts b/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.ts index b1b5a57ca27dc..b0d20b4482728 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.ts @@ -34,7 +34,7 @@ import { SavedDashboardPanel620, SavedDashboardPanel630, SavedDashboardPanel610, -} from '../types'; +} from '../np_ready/types'; const PANEL_HEIGHT_SCALE_FACTOR = 5; const PANEL_HEIGHT_SCALE_FACTOR_WITH_MARGINS = 4; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/migrations/types.ts b/src/legacy/core_plugins/kibana/public/dashboard/migrations/types.ts index 7fba2f4003f31..c264358a8f81f 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/migrations/types.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/migrations/types.ts @@ -17,7 +17,7 @@ * under the License. */ -import { GridData } from '../types'; +import { GridData } from '../np_ready/types'; import { Doc, DocPre700 } from '../../../migrations/types'; export interface SavedObjectAttributes { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/application.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/application.ts similarity index 95% rename from src/legacy/core_plugins/kibana/public/dashboard/application.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/application.ts index 3482197e381e6..298dcee12dc35 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/application.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/application.ts @@ -19,7 +19,6 @@ import { EuiConfirmModal, EuiIcon } from '@elastic/eui'; import angular, { IModule } from 'angular'; -import { IPrivate } from 'ui/private'; import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular'; import { AppMountContext, @@ -28,7 +27,7 @@ import { SavedObjectsClientContract, IUiSettingsClient, } from 'kibana/public'; -import { Storage } from '../../../../../plugins/kibana_utils/public'; +import { Storage } from '../../../../../../plugins/kibana_utils/public'; import { GlobalStateProvider, StateManagementConfigProvider, @@ -43,14 +42,15 @@ import { RedirectWhenMissingProvider, confirmModalFactory, configureAppAngularModule, -} from './legacy_imports'; + IPrivate, +} from '../legacy_imports'; // @ts-ignore import { initDashboardApp } from './legacy_app'; -import { IEmbeddableStart } from '../../../../../plugins/embeddable/public'; -import { NavigationPublicPluginStart as NavigationStart } from '../../../../../plugins/navigation/public'; -import { DataPublicPluginStart as NpDataStart } from '../../../../../plugins/data/public'; -import { SharePluginStart } from '../../../../../plugins/share/public'; +import { IEmbeddableStart } from '../../../../../../plugins/embeddable/public'; +import { NavigationPublicPluginStart as NavigationStart } from '../../../../../../plugins/navigation/public'; +import { DataPublicPluginStart as NpDataStart } from '../../../../../../plugins/data/public'; +import { SharePluginStart } from '../../../../../../plugins/share/public'; export interface RenderDeps { core: LegacyCoreStart; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.html b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.html rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.html diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.tsx similarity index 94% rename from src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.tsx index 04a8e68276fc2..e9fdc335ba572 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.tsx @@ -25,10 +25,10 @@ import { AppState as TAppState, IInjector, KbnUrl, -} from './legacy_imports'; +} from '../legacy_imports'; -import { ViewMode } from '../../../embeddable_api/public/np_ready/public'; -import { SavedObjectDashboard } from './saved_dashboard/saved_dashboard'; +import { ViewMode } from '../../../../embeddable_api/public/np_ready/public'; +import { SavedObjectDashboard } from '../saved_dashboard/saved_dashboard'; import { DashboardAppState, SavedDashboardPanel, ConfirmModalFn } from './types'; import { IIndexPattern, @@ -36,7 +36,7 @@ import { Query, esFilters, SavedQuery, -} from '../../../../../../src/plugins/data/public'; +} from '../../../../../../plugins/data/public'; import { DashboardAppController } from './dashboard_app_controller'; import { RenderDeps } from './application'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx similarity index 98% rename from src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx index 24b64a88998f4..5ba457b6c3362 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx @@ -37,9 +37,10 @@ import { KbnUrl, SavedObjectSaveOpts, unhashUrl, -} from './legacy_imports'; -import { FilterStateManager, IndexPattern } from '../../../data/public'; -import { Query, SavedQuery, IndexPatternsContract } from '../../../../../plugins/data/public'; + VISUALIZE_EMBEDDABLE_TYPE, +} from '../legacy_imports'; +import { FilterStateManager, IndexPattern } from '../../../../data/public'; +import { Query, SavedQuery, IndexPatternsContract } from '../../../../../../plugins/data/public'; import { DashboardContainer, @@ -47,14 +48,14 @@ import { DashboardContainerFactory, DashboardContainerInput, DashboardPanelState, -} from '../../../dashboard_embeddable_container/public/np_ready/public'; +} from '../../../../dashboard_embeddable_container/public/np_ready/public'; import { isErrorEmbeddable, ErrorEmbeddable, ViewMode, openAddPanelFlyout, EmbeddableFactoryNotFoundError, -} from '../../../embeddable_api/public/np_ready/public'; +} from '../../../../embeddable_api/public/np_ready/public'; import { DashboardAppState, NavAction, ConfirmModalFn, SavedDashboardPanel } from './types'; import { showOptionsPopover } from './top_nav/show_options_popover'; @@ -67,13 +68,12 @@ import { getTopNavConfig } from './top_nav/get_top_nav_config'; import { TopNavIds } from './top_nav/top_nav_ids'; import { getDashboardTitle } from './dashboard_strings'; import { DashboardAppScope } from './dashboard_app'; -import { VISUALIZE_EMBEDDABLE_TYPE } from '../visualize/embeddable'; import { convertSavedDashboardPanelToPanelState } from './lib/embeddable_saved_object_converters'; import { RenderDeps } from './application'; import { SavedObjectFinderProps, SavedObjectFinderUi, -} from '../../../../../plugins/kibana_react/public'; +} from '../../../../../../plugins/kibana_react/public'; export interface DashboardAppControllerDependencies extends RenderDeps { $scope: DashboardAppScope; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_constants.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/dashboard_constants.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants.ts diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_empty_screen.tsx b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/dashboard_empty_screen.tsx rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen.tsx diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_empty_screen_constants.tsx b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen_constants.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/dashboard_empty_screen_constants.tsx rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen_constants.tsx diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state.test.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state.test.ts similarity index 96% rename from src/legacy/core_plugins/kibana/public/dashboard/dashboard_state.test.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state.test.ts index e810867c699e0..3153a42a63544 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state.test.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state.test.ts @@ -19,8 +19,8 @@ import './np_core.test.mocks'; import { DashboardStateManager } from './dashboard_state_manager'; -import { getAppStateMock, getSavedDashboardMock } from './__tests__'; -import { AppStateClass } from './legacy_imports'; +import { getAppStateMock, getSavedDashboardMock } from '../__tests__'; +import { AppStateClass } from '../legacy_imports'; import { DashboardAppState } from './types'; import { TimeRange, TimefilterContract, InputTimeRange } from 'src/plugins/data/public'; import { ViewMode } from 'src/plugins/embeddable/public'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state_manager.ts similarity index 98% rename from src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state_manager.ts index ac8628ec2a9d9..6df18757da6f5 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_state_manager.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state_manager.ts @@ -23,23 +23,23 @@ import _ from 'lodash'; import { Moment } from 'moment'; import { DashboardContainer } from 'src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public'; -import { ViewMode } from '../../../../../../src/plugins/embeddable/public'; +import { ViewMode } from '../../../../../../plugins/embeddable/public'; import { stateMonitorFactory, StateMonitor, AppStateClass as TAppStateClass, migrateLegacyQuery, -} from './legacy_imports'; +} from '../legacy_imports'; import { Query, esFilters, TimefilterContract as Timefilter, -} from '../../../../../../src/plugins/data/public'; +} from '../../../../../../plugins/data/public'; import { getAppStateDefaults, migrateAppState } from './lib'; import { convertPanelStateToSavedDashboardPanel } from './lib/embeddable_saved_object_converters'; import { FilterUtils } from './lib/filter_utils'; -import { SavedObjectDashboard } from './saved_dashboard/saved_dashboard'; +import { SavedObjectDashboard } from '../saved_dashboard/saved_dashboard'; import { SavedDashboardPanel, DashboardAppState, DashboardAppStateDefaults } from './types'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_strings.ts similarity index 96% rename from src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_strings.ts index d932116d08dc8..d9406ccba18ba 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_strings.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_strings.ts @@ -18,7 +18,7 @@ */ import { i18n } from '@kbn/i18n'; -import { ViewMode } from '../../../../../../src/plugins/embeddable/public'; +import { ViewMode } from '../../../../../../plugins/embeddable/public'; /** * @param title {string} the current title of the dashboard diff --git a/src/legacy/core_plugins/kibana/public/dashboard/global_state_sync.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/global_state_sync.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/dashboard/global_state_sync.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/global_state_sync.ts index 8a733f940734b..1a6c2b09ee3fc 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/global_state_sync.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/global_state_sync.ts @@ -17,8 +17,8 @@ * under the License. */ -import { State } from './legacy_imports'; -import { DataPublicPluginStart as NpDataStart } from '../../../../../plugins/data/public'; +import { State } from '../legacy_imports'; +import { DataPublicPluginStart as NpDataStart } from '../../../../../../plugins/data/public'; /** * Helper function to sync the global state with the various state providers diff --git a/src/legacy/core_plugins/kibana/public/dashboard/help_menu/help_menu_util.js b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/help_menu/help_menu_util.ts similarity index 80% rename from src/legacy/core_plugins/kibana/public/dashboard/help_menu/help_menu_util.js rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/help_menu/help_menu_util.ts index 55abfa179b56d..bc281c6eb340f 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/help_menu/help_menu_util.js +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/help_menu/help_menu_util.ts @@ -18,9 +18,12 @@ */ import { i18n } from '@kbn/i18n'; -import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; +import { CoreStart } from 'kibana/public'; -export function addHelpMenuToAppChrome(chrome) { +export function addHelpMenuToAppChrome( + chrome: CoreStart['chrome'], + docLinks: CoreStart['docLinks'] +) { chrome.setHelpExtension({ appName: i18n.translate('kbn.dashboard.helpMenu.appName', { defaultMessage: 'Dashboards', @@ -28,7 +31,7 @@ export function addHelpMenuToAppChrome(chrome) { links: [ { linkType: 'documentation', - href: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html`, + href: `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/dashboard.html`, }, ], }); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/legacy_app.js b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/legacy_app.js similarity index 92% rename from src/legacy/core_plugins/kibana/public/dashboard/legacy_app.js rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/legacy_app.js index 927717948168a..a4fda5eda8a32 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/legacy_app.js +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/legacy_app.js @@ -22,23 +22,35 @@ import { i18n } from '@kbn/i18n'; import dashboardTemplate from './dashboard_app.html'; import dashboardListingTemplate from './listing/dashboard_listing_ng_wrapper.html'; -import { ensureDefaultIndexPattern } from './legacy_imports'; +import { + ensureDefaultIndexPattern, + registerTimefilterWithGlobalStateFactory, +} from '../legacy_imports'; import { initDashboardAppDirective } from './dashboard_app'; import { DashboardConstants, createDashboardEditUrl } from './dashboard_constants'; import { InvalidJSONProperty, SavedObjectNotFound, -} from '../../../../../plugins/kibana_utils/public'; +} from '../../../../../../plugins/kibana_utils/public'; import { DashboardListing, EMPTY_FILTER } from './listing/dashboard_listing'; import { addHelpMenuToAppChrome } from './help_menu/help_menu_util'; -import { registerTimefilterWithGlobalStateFactory } from '../../../../ui/public/timefilter/setup_router'; import { syncOnMount } from './global_state_sync'; export function initDashboardApp(app, deps) { initDashboardAppDirective(app, deps); app.directive('dashboardListing', function(reactDirective) { - return reactDirective(DashboardListing); + return reactDirective(DashboardListing, [ + ['core', { watchDepth: 'reference' }], + ['createItem', { watchDepth: 'reference' }], + ['getViewUrl', { watchDepth: 'reference' }], + ['editItem', { watchDepth: 'reference' }], + ['findItems', { watchDepth: 'reference' }], + ['deleteItems', { watchDepth: 'reference' }], + ['listingLimit', { watchDepth: 'reference' }], + ['hideWriteControls', { watchDepth: 'reference' }], + ['initialFilter', { watchDepth: 'reference' }], + ]); }); function createNewDashboardCtrl($scope) { @@ -116,6 +128,7 @@ export function initDashboardApp(app, deps) { }, ]); addHelpMenuToAppChrome(deps.chrome, deps.core.docLinks); + $scope.core = deps.core; }, resolve: { dash: function($rootScope, $route, redirectWhenMissing, kbnUrl) { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.test.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/embeddable_saved_object_converters.test.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.test.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/embeddable_saved_object_converters.test.ts diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/embeddable_saved_object_converters.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/lib/embeddable_saved_object_converters.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/embeddable_saved_object_converters.ts diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/filter_utils.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/filter_utils.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/dashboard/lib/filter_utils.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/filter_utils.ts index 19a0c32210737..6fbc04969b1c8 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/lib/filter_utils.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/filter_utils.ts @@ -19,7 +19,7 @@ import _ from 'lodash'; import moment, { Moment } from 'moment'; -import { esFilters } from '../../../../../../plugins/data/public'; +import { esFilters } from '../../../../../../../plugins/data/public'; /** * @typedef {Object} QueryFilter diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/get_app_state_defaults.ts similarity index 90% rename from src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/get_app_state_defaults.ts index eb4a4356fb27a..eceb51f17d164 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/lib/get_app_state_defaults.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/get_app_state_defaults.ts @@ -17,8 +17,8 @@ * under the License. */ -import { ViewMode } from '../../../../../../../src/plugins/embeddable/public'; -import { SavedObjectDashboard } from '../saved_dashboard/saved_dashboard'; +import { ViewMode } from '../../../../../../../plugins/embeddable/public'; +import { SavedObjectDashboard } from '../../saved_dashboard/saved_dashboard'; import { DashboardAppStateDefaults } from '../types'; export function getAppStateDefaults( diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/index.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/lib/index.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/index.ts diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/migrate_app_state.test.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.test.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/lib/migrate_app_state.test.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.test.ts diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/migrate_app_state.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.ts similarity index 96% rename from src/legacy/core_plugins/kibana/public/dashboard/lib/migrate_app_state.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.ts index c4ad754548459..4083900c7ede7 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/lib/migrate_app_state.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.ts @@ -19,7 +19,7 @@ import semver from 'semver'; import { i18n } from '@kbn/i18n'; -import { createUiStatsReporter, METRIC_TYPE } from '../../../../ui_metric/public'; +import { createUiStatsReporter, METRIC_TYPE } from '../../../../../ui_metric/public'; import { DashboardAppState, SavedDashboardPanelTo60, @@ -29,7 +29,7 @@ import { SavedDashboardPanel640To720, SavedDashboardPanel620, } from '../types'; -import { migratePanelsTo730 } from '../migrations/migrate_to_730_panels'; +import { migratePanelsTo730 } from '../../migrations/migrate_to_730_panels'; /** * Attempts to migrate the state stored in the URL into the latest version of it. diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/save_dashboard.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/save_dashboard.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/dashboard/lib/save_dashboard.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/save_dashboard.ts index e322677433ce6..691c87122564f 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/lib/save_dashboard.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/save_dashboard.ts @@ -18,7 +18,7 @@ */ import { TimefilterContract } from 'src/plugins/data/public'; -import { SavedObjectSaveOpts } from '../legacy_imports'; +import { SavedObjectSaveOpts } from '../../legacy_imports'; import { updateSavedDashboard } from './update_saved_dashboard'; import { DashboardStateManager } from '../dashboard_state_manager'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/lib/update_saved_dashboard.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/update_saved_dashboard.ts similarity index 93% rename from src/legacy/core_plugins/kibana/public/dashboard/lib/update_saved_dashboard.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/update_saved_dashboard.ts index ce9096b3a56f0..2072b5d4f6eb0 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/lib/update_saved_dashboard.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/update_saved_dashboard.ts @@ -19,9 +19,9 @@ import _ from 'lodash'; import { RefreshInterval, TimefilterContract } from 'src/plugins/data/public'; -import { AppState } from '../legacy_imports'; +import { AppState } from '../../legacy_imports'; import { FilterUtils } from './filter_utils'; -import { SavedObjectDashboard } from '../saved_dashboard/saved_dashboard'; +import { SavedObjectDashboard } from '../../saved_dashboard/saved_dashboard'; export function updateSavedDashboard( savedDashboard: SavedObjectDashboard, diff --git a/src/legacy/core_plugins/kibana/public/dashboard/listing/__snapshots__/dashboard_listing.test.js.snap b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/__snapshots__/dashboard_listing.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/listing/__snapshots__/dashboard_listing.test.js.snap rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/__snapshots__/dashboard_listing.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/dashboard/listing/dashboard_listing.js b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.js similarity index 96% rename from src/legacy/core_plugins/kibana/public/dashboard/listing/dashboard_listing.js rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.js index 2946597581fdb..827fe6eabe784 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/listing/dashboard_listing.js +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.js @@ -23,9 +23,8 @@ import PropTypes from 'prop-types'; import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; import { EuiLink, EuiButton, EuiEmptyPrompt } from '@elastic/eui'; -import { npStart } from 'ui/new_platform'; -import { TableListView } from '../../../../../../../src/plugins/kibana_react/public'; +import { TableListView } from '../../../../../../../plugins/kibana_react/public'; export const EMPTY_FILTER = ''; @@ -60,8 +59,8 @@ export class DashboardListing extends React.Component { tableListTitle={i18n.translate('kbn.dashboard.listing.dashboardsTitle', { defaultMessage: 'Dashboards', })} - toastNotifications={npStart.core.notifications.toasts} - uiSettings={npStart.core.uiSettings} + toastNotifications={this.props.core.notifications.toasts} + uiSettings={this.props.core.uiSettings} /> ); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/listing/dashboard_listing.test.js b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.test.js similarity index 90% rename from src/legacy/core_plugins/kibana/public/dashboard/listing/dashboard_listing.test.js rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.test.js index a933607d256a9..c47a54ad60460 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/listing/dashboard_listing.test.js +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.test.js @@ -42,17 +42,6 @@ jest.mock( { virtual: true } ); -jest.mock('ui/new_platform', () => { - return { - npStart: { - core: { - notifications: { toasts: {} }, - uiSettings: { get: jest.fn(() => 10) }, - }, - }, - }; -}); - import React from 'react'; import { shallow } from 'enzyme'; @@ -83,6 +72,7 @@ test('renders empty page in before initial fetch to avoid flickering', () => { getViewUrl={() => {}} listingLimit={1000} hideWriteControls={false} + core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} /> ); expect(component).toMatchSnapshot(); @@ -100,6 +90,7 @@ describe('after fetch', () => { listingLimit={1000} hideWriteControls={false} initialFilter="my dashboard" + core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} /> ); @@ -121,6 +112,7 @@ describe('after fetch', () => { getViewUrl={() => {}} listingLimit={1000} hideWriteControls={false} + core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} /> ); @@ -142,6 +134,7 @@ describe('after fetch', () => { getViewUrl={() => {}} listingLimit={1} hideWriteControls={false} + core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} /> ); @@ -163,6 +156,7 @@ describe('after fetch', () => { getViewUrl={() => {}} listingLimit={1} hideWriteControls={true} + core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} /> ); @@ -184,6 +178,7 @@ describe('after fetch', () => { getViewUrl={() => {}} listingLimit={1} hideWriteControls={false} + core={{ notifications: { toasts: {} }, uiSettings: { get: jest.fn(() => 10) } }} /> ); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/listing/dashboard_listing_ng_wrapper.html b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing_ng_wrapper.html similarity index 94% rename from src/legacy/core_plugins/kibana/public/dashboard/listing/dashboard_listing_ng_wrapper.html rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing_ng_wrapper.html index a1dd9f30bdd81..f473e91af7ae9 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/listing/dashboard_listing_ng_wrapper.html +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing_ng_wrapper.html @@ -1,4 +1,5 @@ ({ +jest.mock('../../legacy_imports', () => ({ SavedObjectSaveModal: () => null, })); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/top_nav/save_modal.tsx b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.tsx similarity index 98% rename from src/legacy/core_plugins/kibana/public/dashboard/top_nav/save_modal.tsx rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.tsx index 0640b2be431be..bd53fd5a13083 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/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 '../../legacy_imports'; interface SaveOptions { newTitle: string; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/top_nav/show_clone_modal.tsx b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/show_clone_modal.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/top_nav/show_clone_modal.tsx rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/show_clone_modal.tsx diff --git a/src/legacy/core_plugins/kibana/public/dashboard/top_nav/show_options_popover.tsx b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/show_options_popover.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/top_nav/show_options_popover.tsx rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/show_options_popover.tsx diff --git a/src/legacy/core_plugins/kibana/public/dashboard/top_nav/top_nav_ids.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/top_nav_ids.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/top_nav/top_nav_ids.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/top_nav_ids.ts diff --git a/src/legacy/core_plugins/kibana/public/dashboard/types.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/types.ts similarity index 96% rename from src/legacy/core_plugins/kibana/public/dashboard/types.ts rename to src/legacy/core_plugins/kibana/public/dashboard/np_ready/types.ts index 371274401739e..e3eb25a208856 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/types.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/types.ts @@ -18,7 +18,7 @@ */ import { ViewMode } from 'src/plugins/embeddable/public'; -import { AppState } from './legacy_imports'; +import { AppState } from '../legacy_imports'; import { RawSavedDashboardPanelTo60, RawSavedDashboardPanel610, @@ -26,8 +26,8 @@ import { RawSavedDashboardPanel630, RawSavedDashboardPanel640To720, RawSavedDashboardPanel730ToLatest, -} from './migrations/types'; -import { Query, esFilters } from '../../../../../plugins/data/public'; +} from '../migrations/types'; +import { Query, esFilters } from '../../../../../../plugins/data/public'; export type NavAction = (anchorElement?: any) => void; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/plugin.ts b/src/legacy/core_plugins/kibana/public/dashboard/plugin.ts index 0e61576673937..f56bcf5b5533b 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/plugin.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/plugin.ts @@ -26,14 +26,14 @@ import { SavedObjectsClientContract, } from 'kibana/public'; import { i18n } from '@kbn/i18n'; -import { RenderDeps } from './application'; +import { RenderDeps } from './np_ready/application'; import { DataStart } from '../../../data/public'; import { DataPublicPluginStart as NpDataStart } from '../../../../../plugins/data/public'; import { IEmbeddableStart } from '../../../../../plugins/embeddable/public'; import { Storage } from '../../../../../plugins/kibana_utils/public'; import { NavigationPublicPluginStart as NavigationStart } from '../../../../../plugins/navigation/public'; -import { DashboardConstants } from './dashboard_constants'; import { SharePluginStart } from '../../../../../plugins/share/public'; +import { DashboardConstants } from './np_ready/dashboard_constants'; import { HomePublicPluginSetup, FeatureCatalogueCategory, @@ -105,7 +105,7 @@ export class DashboardPlugin implements Plugin { dashboardCapabilities: contextCore.application.capabilities.dashboard, localStorage: new Storage(localStorage), }; - const { renderApp } = await import('./application'); + const { renderApp } = await import('./np_ready/application'); return renderApp(params.element, params.appBasePath, deps); }, }; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/saved_dashboard/saved_dashboard.ts b/src/legacy/core_plugins/kibana/public/dashboard/saved_dashboard/saved_dashboard.ts index dc52b3ab7ad17..7f4d7402fcffc 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/saved_dashboard/saved_dashboard.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/saved_dashboard/saved_dashboard.ts @@ -20,9 +20,9 @@ import { SearchSourceContract } from 'ui/courier'; import { SavedObject, SavedObjectKibanaServices } from 'ui/saved_objects/types'; import { createSavedObjectClass } from 'ui/saved_objects/saved_object'; import { extractReferences, injectReferences } from './saved_dashboard_references'; -import { createDashboardEditUrl } from '../dashboard_constants'; import { esFilters, Query, RefreshInterval } from '../../../../../../plugins/data/public'; +import { createDashboardEditUrl } from '..'; export interface SavedObjectDashboard extends SavedObject { id?: string; diff --git a/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js index dcd04d31af076..378a9e9325655 100644 --- a/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js +++ b/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import { pluginInstance } from 'plugins/kibana/discover/index'; import ngMock from 'ng_mock'; -import { fieldCalculator } from '../../components/field_chooser/lib/field_calculator'; +import { fieldCalculator } from '../../np_ready/components/field_chooser/lib/field_calculator'; import expect from '@kbn/expect'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/__tests__/doc_table.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/doc_table/doc_table.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/__tests__/doc_table.js rename to src/legacy/core_plugins/kibana/public/discover/__tests__/doc_table/doc_table.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/__tests__/lib/get_sort.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/doc_table/lib/get_sort.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/__tests__/lib/get_sort.js rename to src/legacy/core_plugins/kibana/public/discover/__tests__/doc_table/lib/get_sort.js index f264f0fb4d754..d9fdcc48608d2 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/__tests__/lib/get_sort.js +++ b/src/legacy/core_plugins/kibana/public/discover/__tests__/doc_table/lib/get_sort.js @@ -20,7 +20,7 @@ import expect from '@kbn/expect'; import ngMock from 'ng_mock'; -import { getSort } from '../../lib/get_sort'; +import { getSort } from '../../../np_ready/angular/doc_table/lib/get_sort'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; const defaultSort = [{ time: 'desc' }]; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/__tests__/lib/rows_headers.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/doc_table/lib/rows_headers.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/__tests__/lib/rows_headers.js rename to src/legacy/core_plugins/kibana/public/discover/__tests__/doc_table/lib/rows_headers.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/_utils.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/_utils.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/_utils.js rename to src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/_utils.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_add_filter.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_add_filter.js similarity index 93% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_add_filter.js rename to src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_add_filter.js index 1dbdea4c89f00..90614cf3c132c 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_add_filter.js +++ b/src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_add_filter.js @@ -20,8 +20,8 @@ import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { createStateStub } from './_utils'; -import { getQueryParameterActions } from '../actions'; -import { createIndexPatternsStub } from '../../api/__tests__/_stubs'; +import { getQueryParameterActions } from '../../np_ready/angular/context/query_parameters/actions'; +import { createIndexPatternsStub } from '../../np_ready/angular/context/api/__tests__/_stubs'; import { pluginInstance } from 'plugins/kibana/discover/index'; import { npStart } from 'ui/new_platform'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_set_predecessor_count.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_set_predecessor_count.js similarity index 95% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_set_predecessor_count.js rename to src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_set_predecessor_count.js index 52db1bab64945..1ad4bdbea210d 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_set_predecessor_count.js +++ b/src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_set_predecessor_count.js @@ -21,7 +21,7 @@ import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { pluginInstance } from 'plugins/kibana/discover/index'; import { createStateStub } from './_utils'; -import { getQueryParameterActions } from '../actions'; +import { getQueryParameterActions } from '../../np_ready/angular/context/query_parameters/actions'; describe('context app', function() { beforeEach(() => pluginInstance.initializeInnerAngular()); diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_set_query_parameters.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_set_query_parameters.js similarity index 96% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_set_query_parameters.js rename to src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_set_query_parameters.js index 6cc5e1ae6db04..e9ec2c300faa1 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_set_query_parameters.js +++ b/src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_set_query_parameters.js @@ -22,7 +22,7 @@ import ngMock from 'ng_mock'; import { pluginInstance } from 'plugins/kibana/discover/index'; import { createStateStub } from './_utils'; -import { getQueryParameterActions } from '../actions'; +import { getQueryParameterActions } from '../../np_ready/angular/context/query_parameters/actions'; describe('context app', function() { beforeEach(() => pluginInstance.initializeInnerAngular()); diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_set_successor_count.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_set_successor_count.js similarity index 95% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_set_successor_count.js rename to src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_set_successor_count.js index a976cf0d04d20..15f3eefac3fd1 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/__tests__/action_set_successor_count.js +++ b/src/legacy/core_plugins/kibana/public/discover/__tests__/query_parameters/action_set_successor_count.js @@ -22,7 +22,7 @@ import ngMock from 'ng_mock'; import { pluginInstance } from 'plugins/kibana/discover/index'; import { createStateStub } from './_utils'; -import { getQueryParameterActions } from '../actions'; +import { getQueryParameterActions } from '../../np_ready/angular/context/query_parameters/actions'; describe('context app', function() { beforeEach(() => pluginInstance.initializeInnerAngular()); diff --git a/src/legacy/core_plugins/kibana/public/discover/_index.scss b/src/legacy/core_plugins/kibana/public/discover/_index.scss index 0d70bb993fac1..386472a9f6e01 100644 --- a/src/legacy/core_plugins/kibana/public/discover/_index.scss +++ b/src/legacy/core_plugins/kibana/public/discover/_index.scss @@ -1,26 +1,2 @@ // Discover plugin styles -@import 'mixins'; - -// Prefix all styles with "dsc" to avoid conflicts. -// Examples -// dscTable -// dscTable__footer -// monChart__legend--small -// monChart__legend-isLoading - -@import 'components/fetch_error/index'; -@import 'components/field_chooser/index'; -@import 'angular/directives/index'; -@import 'angular/doc_table/index'; - -@import 'hacks'; - -@import 'discover'; - -@import 'embeddable/index'; - -// Doc Viewer -@import 'components/doc_viewer/index'; - -// Context styles -@import 'angular/context/index'; +@import 'np_ready/index'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/_index.scss b/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/_index.scss deleted file mode 100644 index 23d6609a5cffb..0000000000000 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/_index.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import './doc_table'; -@import './components/index'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/_index.scss b/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/_index.scss deleted file mode 100644 index a73ff41db7c03..0000000000000 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/_index.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import './table_header'; -@import './table_row/index'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/_index.scss b/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/_index.scss deleted file mode 100644 index a452ce140ba93..0000000000000 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/_index.scss +++ /dev/null @@ -1,3 +0,0 @@ -@import './cell'; -@import './details'; -@import './open'; diff --git a/src/legacy/core_plugins/kibana/public/discover/helpers/build_services.ts b/src/legacy/core_plugins/kibana/public/discover/build_services.ts similarity index 88% rename from src/legacy/core_plugins/kibana/public/discover/helpers/build_services.ts rename to src/legacy/core_plugins/kibana/public/discover/build_services.ts index 27c7c00fb729c..aaacde7e4060f 100644 --- a/src/legacy/core_plugins/kibana/public/discover/helpers/build_services.ts +++ b/src/legacy/core_plugins/kibana/public/discover/build_services.ts @@ -26,14 +26,13 @@ import { } from 'kibana/public'; import * as docViewsRegistry from 'ui/registry/doc_views'; import { FilterManager, TimefilterContract, IndexPatternsContract } from 'src/plugins/data/public'; +import { createSavedSearchesService } from './saved_searches'; // @ts-ignore -import { createSavedSearchesService } from '../saved_searches'; -// @ts-ignore -import { DiscoverStartPlugins } from '../plugin'; -import { DataStart } from '../../../../data/public'; -import { EuiUtilsStart } from '../../../../../../plugins/eui_utils/public'; -import { SavedSearch } from '../types'; -import { SharePluginStart } from '../../../../../../plugins/share/public'; +import { DiscoverStartPlugins } from './plugin'; +import { DataStart } from '../../../data/public'; +import { EuiUtilsStart } from '../../../../../plugins/eui_utils/public'; +import { SharePluginStart } from '../../../../../plugins/share/public'; +import { SavedSearch } from './np_ready/types'; export interface DiscoverServices { addBasePath: (path: string) => string; diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/_index.scss b/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/_index.scss deleted file mode 100644 index ad65834519eb1..0000000000000 --- a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './field_chooser'; diff --git a/src/legacy/core_plugins/kibana/public/discover/get_inner_angular.ts b/src/legacy/core_plugins/kibana/public/discover/get_inner_angular.ts index 1335dbb01d4a7..1cefabe08c2d5 100644 --- a/src/legacy/core_plugins/kibana/public/discover/get_inner_angular.ts +++ b/src/legacy/core_plugins/kibana/public/discover/get_inner_angular.ts @@ -69,24 +69,24 @@ import { configureAppAngularModule } from 'ui/legacy_compat'; import { IndexPatterns } from '../../../../../plugins/data/public'; import { Storage } from '../../../../../plugins/kibana_utils/public'; import { NavigationPublicPluginStart as NavigationStart } from '../../../../../plugins/navigation/public'; -import { createDocTableDirective } from './angular/doc_table/doc_table'; -import { createTableHeaderDirective } from './angular/doc_table/components/table_header'; +import { createDocTableDirective } from './np_ready/angular/doc_table/doc_table'; +import { createTableHeaderDirective } from './np_ready/angular/doc_table/components/table_header'; import { createToolBarPagerButtonsDirective, createToolBarPagerTextDirective, -} from './angular/doc_table/components/pager'; -import { createTableRowDirective } from './angular/doc_table/components/table_row'; -import { createPagerFactory } from './angular/doc_table/lib/pager/pager_factory'; -import { createInfiniteScrollDirective } from './angular/doc_table/infinite_scroll'; -import { createDocViewerDirective } from './angular/doc_viewer'; -import { createFieldSearchDirective } from './components/field_chooser/discover_field_search_directive'; -import { createIndexPatternSelectDirective } from './components/field_chooser/discover_index_pattern_directive'; -import { createStringFieldProgressBarDirective } from './components/field_chooser/string_progress_bar'; +} from './np_ready/angular/doc_table/components/pager'; +import { createTableRowDirective } from './np_ready/angular/doc_table/components/table_row'; +import { createPagerFactory } from './np_ready/angular/doc_table/lib/pager/pager_factory'; +import { createInfiniteScrollDirective } from './np_ready/angular/doc_table/infinite_scroll'; +import { createDocViewerDirective } from './np_ready/angular/doc_viewer'; +import { createFieldSearchDirective } from './np_ready/components/field_chooser/discover_field_search_directive'; +import { createIndexPatternSelectDirective } from './np_ready/components/field_chooser/discover_index_pattern_directive'; +import { createStringFieldProgressBarDirective } from './np_ready/components/field_chooser/string_progress_bar'; // @ts-ignore -import { createFieldChooserDirective } from './components/field_chooser/field_chooser'; +import { createFieldChooserDirective } from './np_ready/components/field_chooser/field_chooser'; // @ts-ignore -import { createDiscoverFieldDirective } from './components/field_chooser/discover_field'; +import { createDiscoverFieldDirective } from './np_ready/components/field_chooser/discover_field'; import { DiscoverStartPlugins } from './plugin'; /** 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 d13d0dc868a58..ae388a243dd2b 100644 --- a/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts +++ b/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts @@ -17,7 +17,7 @@ * under the License. */ import angular from 'angular'; // just used in embeddables and discover controller -import { DiscoverServices } from './helpers/build_services'; +import { DiscoverServices } from './build_services'; let angularModule: any = null; let services: DiscoverServices | null = null; @@ -47,6 +47,10 @@ export function setServices(newServices: any) { services = newServices; } +// import directives that +import 'ui/directives/css_truncate'; +import 'ui/directives/field_name'; + // EXPORT legacy static dependencies, should be migrated when available in a new version; export { angular }; export { wrapInI18nContext } from 'ui/i18n'; @@ -59,6 +63,9 @@ export { hasSearchStategyForIndexPattern, isDefaultTypeIndexPattern, SearchSource, + EsQuerySortValue, + SortDirection, + SearchSourceContract, } from '../../../../ui/public/courier'; // @ts-ignore export { intervalOptions } from 'ui/agg_types/buckets/_interval_options'; @@ -78,6 +85,8 @@ export { tabifyAggResponse } from 'ui/agg_response/tabify'; export { vislibSeriesResponseHandlerProvider } from 'ui/vis/response_handlers/vislib'; export { ensureDefaultIndexPattern } from 'ui/legacy_compat'; export { unhashUrl } from '../../../../../plugins/kibana_utils/public'; +// @ts-ignore +export { formatMsg, formatStack } from 'ui/notify/lib/index'; // EXPORT types export { Vis } from 'ui/vis'; @@ -90,3 +99,6 @@ export { export { ElasticSearchHit } from 'ui/registry/doc_views_types'; export { DocViewRenderProps, DocViewRenderFn } from 'ui/registry/doc_views'; export { Adapters } from 'ui/inspector/types'; +export { DocView, DocViewInput } from 'ui/registry/doc_views_types'; +export { registerTimefilterWithGlobalStateFactory } from 'ui/timefilter/setup_router'; +export { IInjector } from 'ui/chrome'; diff --git a/src/legacy/core_plugins/kibana/public/discover/_discover.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/_discover.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/_discover.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/_discover.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/_hacks.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/_hacks.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/_hacks.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/_hacks.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/_index.scss new file mode 100644 index 0000000000000..0de036b1e1707 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/_index.scss @@ -0,0 +1,15 @@ +// Discover plugin styles +@import 'mixins'; +@import 'discover'; +@import 'hacks'; + +// Prefix all styles with "dsc" to avoid conflicts. +// Examples +// dscTable +// dscTable__footer +// monChart__legend--small +// monChart__legend-isLoading + +@import 'components/index'; +@import 'angular/index'; +@import 'embeddable/index'; diff --git a/src/legacy/core_plugins/kibana/public/discover/_mixins.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/_mixins.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/_mixins.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/_mixins.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/_index.scss new file mode 100644 index 0000000000000..9e00ade3d41f6 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/_index.scss @@ -0,0 +1,3 @@ +@import 'directives/index'; +@import 'doc_table/index'; +@import 'context/index'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.html diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/angular/context.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.js index d33e3424e4647..a370c66ae330b 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.js @@ -19,12 +19,12 @@ import _ from 'lodash'; import { i18n } from '@kbn/i18n'; -import { getAngularModule, getServices, subscribeWithScope } from './../kibana_services'; +import { getAngularModule, getServices, subscribeWithScope } from '../../kibana_services'; import './context_app'; import contextAppRouteTemplate from './context.html'; import { getRootBreadcrumbs } from '../helpers/breadcrumbs'; -import { FilterStateManager } from '../../../../data/public/filter/filter_manager'; +import { FilterStateManager } from '../../../../../data/public'; const { chrome } = getServices(); const k7Breadcrumbs = $route => { diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/NOTES.md b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/NOTES.md similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/NOTES.md rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/NOTES.md diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/_index.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/_index.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/_index.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/__tests__/_stubs.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/__tests__/_stubs.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/__tests__/_stubs.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/__tests__/_stubs.js index 3bc83cacaaf28..53be4e5bd0f2d 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/__tests__/_stubs.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/__tests__/_stubs.js @@ -19,7 +19,7 @@ import sinon from 'sinon'; import moment from 'moment'; -import { SearchSource } from '../../../../kibana_services'; +import { SearchSource } from '../../../../../kibana_services'; export function createIndexPatternsStub() { return { diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/__tests__/anchor.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/__tests__/anchor.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/__tests__/anchor.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/__tests__/anchor.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/__tests__/predecessors.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/__tests__/predecessors.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/__tests__/predecessors.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/__tests__/predecessors.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/__tests__/successors.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/__tests__/successors.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/__tests__/successors.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/__tests__/successors.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/anchor.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/anchor.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/anchor.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/anchor.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/context.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/context.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/context.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/context.ts index fd71b7c49e837..a6c6d91084625 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/context.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/context.ts @@ -17,14 +17,14 @@ * under the License. */ -import { IndexPattern, SearchSource } from '../../../kibana_services'; +import { IndexPattern, SearchSource } from '../../../../kibana_services'; import { reverseSortDir, SortDirection } from './utils/sorting'; import { extractNanos, convertIsoToMillis } from './utils/date_conversion'; import { fetchHitsInInterval } from './utils/fetch_hits_in_interval'; import { generateIntervals } from './utils/generate_intervals'; import { getEsQuerySearchAfter } from './utils/get_es_query_search_after'; import { getEsQuerySort } from './utils/get_es_query_sort'; -import { esFilters, IndexPatternsContract } from '../../../../../../../../plugins/data/public'; +import { esFilters, IndexPatternsContract } from '../../../../../../../../../plugins/data/public'; export type SurrDocType = 'successors' | 'predecessors'; export interface EsHitRecord { diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/__tests__/date_conversion.test.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/__tests__/date_conversion.test.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/__tests__/date_conversion.test.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/__tests__/date_conversion.test.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/__tests__/sorting.test.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/__tests__/sorting.test.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/__tests__/sorting.test.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/__tests__/sorting.test.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/date_conversion.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/date_conversion.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/date_conversion.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/date_conversion.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/fetch_hits_in_interval.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/fetch_hits_in_interval.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/fetch_hits_in_interval.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/fetch_hits_in_interval.ts index 19c2ee2cdfe10..1351421e1af04 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/fetch_hits_in_interval.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/fetch_hits_in_interval.ts @@ -20,7 +20,7 @@ import { EsQuerySortValue, SortDirection, SearchSourceContract, -} from '../../../../../../../../ui/public/courier'; +} from '../../../../../kibana_services'; import { convertTimeValueToIso } from './date_conversion'; import { EsHitRecordList } from '../context'; import { IntervalValue } from './generate_intervals'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/generate_intervals.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/generate_intervals.ts similarity index 96% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/generate_intervals.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/generate_intervals.ts index cb4878239ff92..373dc37e56f6f 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/generate_intervals.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/generate_intervals.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SortDirection } from '../../../../../../../../ui/public/courier'; +import { SortDirection } from '../../../../../kibana_services'; export type IntervalValue = number | null; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/get_es_query_search_after.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/get_es_query_search_after.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/get_es_query_search_after.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/get_es_query_search_after.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/get_es_query_sort.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/get_es_query_sort.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/get_es_query_sort.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/get_es_query_sort.ts index 39c69112e58cb..8bcf5328f24ba 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/get_es_query_sort.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/get_es_query_sort.ts @@ -17,7 +17,7 @@ * under the License. */ -import { EsQuerySortValue, SortDirection } from '../../../../../../../../ui/public/courier/types'; +import { EsQuerySortValue, SortDirection } from '../../../../../kibana_services'; /** * Returns `EsQuerySort` which is used to sort records in the ES query diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/sorting.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/sorting.ts similarity index 96% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/sorting.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/sorting.ts index 4a0f531845f46..ef1be8d48d338 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/api/utils/sorting.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/utils/sorting.ts @@ -17,7 +17,7 @@ * under the License. */ -import { IndexPattern } from '../../../../kibana_services'; +import { IndexPattern } from '../../../../../kibana_services'; export enum SortDirection { asc = 'asc', diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/_action_bar.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/_action_bar.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/_action_bar.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/_action_bar.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/_index.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/_index.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/_index.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/action_bar.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/action_bar.test.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/action_bar.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/action_bar.test.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/action_bar.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/action_bar.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/action_bar.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/action_bar.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/action_bar_directive.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/action_bar_directive.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/action_bar_directive.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/action_bar_directive.ts index 55a378367392c..697b039adde81 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/action_bar_directive.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/action_bar_directive.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { getAngularModule, wrapInI18nContext } from '../../../../kibana_services'; +import { getAngularModule, wrapInI18nContext } from '../../../../../kibana_services'; import { ActionBar } from './action_bar'; getAngularModule().directive('contextActionBar', function(reactDirective: any) { diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/action_bar_warning.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/action_bar_warning.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/action_bar_warning.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/action_bar_warning.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/index.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/components/action_bar/index.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/components/action_bar/index.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query/actions.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/actions.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query/actions.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/actions.js index b7f6fab676a1e..966ecffda7755 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/query/actions.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/actions.js @@ -20,13 +20,13 @@ import _ from 'lodash'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { getServices, SearchSource } from '../../../kibana_services'; +import { getServices, SearchSource } from '../../../../kibana_services'; import { fetchAnchorProvider } from '../api/anchor'; import { fetchContextProvider } from '../api/context'; import { getQueryParameterActions } from '../query_parameters'; import { FAILURE_REASONS, LOADING_STATUS } from './constants'; -import { MarkdownSimple } from '../../../../../../kibana_react/public'; +import { MarkdownSimple } from '../../../../../../../kibana_react/public'; export function QueryActionsProvider(Promise) { const fetchAnchor = fetchAnchorProvider(getServices().indexPatterns, new SearchSource()); diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query/constants.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/constants.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query/constants.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/constants.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query/index.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/index.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query/index.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/index.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query/state.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/state.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query/state.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/state.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/actions.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/actions.js similarity index 94% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/actions.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/actions.js index 01573f8983d0f..c5f1836bcc0e1 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/actions.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/actions.js @@ -18,8 +18,8 @@ */ import _ from 'lodash'; -import { getServices } from '../../../kibana_services'; -import { generateFilters } from '../../../../../../../../plugins/data/public'; +import { getServices } from '../../../../kibana_services'; +import { generateFilters } from '../../../../../../../../../plugins/data/public'; import { MAX_CONTEXT_SIZE, MIN_CONTEXT_SIZE, QUERY_PARAMETER_KEYS } from './constants'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/constants.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/constants.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/constants.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/constants.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/index.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/index.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/index.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/index.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/state.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/state.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context/query_parameters/state.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/state.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context_app.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_app.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/context_app.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_app.html diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/context_app.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_app.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/angular/context_app.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_app.js index 3f91980ccc50f..5fa0958249d79 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/context_app.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_app.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import { getServices, callAfterBindingsWorkaround, getAngularModule } from './../kibana_services'; +import { getServices, callAfterBindingsWorkaround, getAngularModule } from '../../kibana_services'; import contextAppTemplate from './context_app.html'; import './context/components/action_bar'; import { getFirstSortableField } from './context/api/utils/sorting'; @@ -36,9 +36,6 @@ import { const { timefilter } = getServices(); -// load directives -import '../../../../data/public/legacy'; - const module = getAngularModule(); module.directive('contextApp', function ContextApp() { diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/directives/__snapshots__/no_results.test.js.snap b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/__snapshots__/no_results.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/directives/__snapshots__/no_results.test.js.snap rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/__snapshots__/no_results.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/directives/_histogram.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/_histogram.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/directives/_histogram.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/_histogram.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/directives/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/_index.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/directives/_index.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/_index.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/directives/_no_results.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/_no_results.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/directives/_no_results.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/_no_results.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/directives/histogram.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/histogram.tsx similarity index 99% rename from src/legacy/core_plugins/kibana/public/discover/angular/directives/histogram.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/histogram.tsx index 496e1cf375588..28ce64c0a5f9c 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/directives/histogram.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/histogram.tsx @@ -45,7 +45,7 @@ import { import { i18n } from '@kbn/i18n'; import { EuiChartThemeType } from '@elastic/eui/src/themes/charts/themes'; import { Subscription } from 'rxjs'; -import { getServices, timezoneProvider } from '../../kibana_services'; +import { getServices, timezoneProvider } from '../../../kibana_services'; export interface DiscoverHistogramProps { chartData: any; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/directives/index.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/index.js similarity index 91% rename from src/legacy/core_plugins/kibana/public/discover/angular/directives/index.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/index.js index eb4cf10a2d28f..1a3922dfc2008 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/directives/index.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/index.js @@ -17,12 +17,11 @@ * under the License. */ -import '../../../../../../ui/public/render_complete/directive'; import { DiscoverNoResults } from './no_results'; import { DiscoverUninitialized } from './uninitialized'; import { DiscoverUnsupportedIndexPattern } from './unsupported_index_pattern'; import { DiscoverHistogram } from './histogram'; -import { getAngularModule, wrapInI18nContext } from '../../kibana_services'; +import { getAngularModule, wrapInI18nContext } from '../../../kibana_services'; const app = getAngularModule(); diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/directives/no_results.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/no_results.js similarity index 99% rename from src/legacy/core_plugins/kibana/public/discover/angular/directives/no_results.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/no_results.js index d22a8d495bd0e..ba02068590c14 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/directives/no_results.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/no_results.js @@ -32,7 +32,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../../../kibana_services'; // eslint-disable-next-line react/prefer-stateless-function export class DiscoverNoResults extends Component { diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/directives/no_results.test.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/no_results.test.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/discover/angular/directives/no_results.test.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/no_results.test.js index 33dff54f94c7f..7de792c612993 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/directives/no_results.test.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/no_results.test.js @@ -22,7 +22,7 @@ import { renderWithIntl } from 'test_utils/enzyme_helpers'; import { DiscoverNoResults } from './no_results'; -jest.mock('../../kibana_services', () => { +jest.mock('../../../kibana_services', () => { return { getServices: () => ({ docLinks: { diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/directives/uninitialized.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/uninitialized.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/directives/uninitialized.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/uninitialized.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/directives/unsupported_index_pattern.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/unsupported_index_pattern.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/directives/unsupported_index_pattern.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/unsupported_index_pattern.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/discover.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/discover.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.html diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/discover.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js similarity index 99% rename from src/legacy/core_plugins/kibana/public/discover/angular/discover.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js index 39a7bb96e11e0..abf025524522b 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/discover.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js @@ -57,7 +57,8 @@ import { SavedObjectSaveModal, getAngularModule, ensureDefaultIndexPattern, -} from '../kibana_services'; + registerTimefilterWithGlobalStateFactory, +} from '../../kibana_services'; const { core, @@ -72,10 +73,9 @@ const { } = getServices(); import { getRootBreadcrumbs, getSavedSearchBreadcrumbs } from '../helpers/breadcrumbs'; -import { generateFilters } from '../../../../../../plugins/data/public'; +import { generateFilters } from '../../../../../../../plugins/data/public'; import { getIndexPatternId } from '../helpers/get_index_pattern_id'; -import { registerTimefilterWithGlobalStateFactory } from '../../../../../ui/public/timefilter/setup_router'; -import { FilterStateManager } from '../../../../data/public/filter/filter_manager'; +import { FilterStateManager } from '../../../../../data/public'; const { getSavedQuery } = data.query.savedQueries; @@ -328,6 +328,7 @@ function discoverController( makeUrl: searchId => { return kbnUrl.eval('#/discover/{{id}}', { id: searchId }); }, + I18nContext: core.i18n.Context, }); }, }; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc.html diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc.ts similarity index 98% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc.ts index af9556656afab..459dcfb30d17b 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { getAngularModule, wrapInI18nContext, getServices } from '../kibana_services'; +import { getAngularModule, wrapInI18nContext, getServices } from '../../kibana_services'; // @ts-ignore import { getRootBreadcrumbs } from '../helpers/breadcrumbs'; import html from './doc.html'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/_doc_table.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/_doc_table.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/_doc_table.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/_doc_table.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/_index.scss new file mode 100644 index 0000000000000..3663d807851c4 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/_index.scss @@ -0,0 +1,2 @@ +@import 'doc_table'; +@import 'components/index'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/actions/columns.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/actions/columns.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/actions/columns.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/actions/columns.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/_index.scss new file mode 100644 index 0000000000000..6a294c1ed173d --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/_index.scss @@ -0,0 +1,2 @@ +@import 'table_header'; +@import 'table_row/index'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/_table_header.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/_table_header.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/_table_header.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/_table_header.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/__snapshots__/tool_bar_pager_buttons.test.tsx.snap b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/__snapshots__/tool_bar_pager_buttons.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/__snapshots__/tool_bar_pager_buttons.test.tsx.snap rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/__snapshots__/tool_bar_pager_buttons.test.tsx.snap diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/__snapshots__/tool_bar_pager_text.test.tsx.snap b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/__snapshots__/tool_bar_pager_text.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/__snapshots__/tool_bar_pager_text.test.tsx.snap rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/__snapshots__/tool_bar_pager_text.test.tsx.snap diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/index.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/index.ts similarity index 94% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/index.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/index.ts index 3a037971a1253..f21f3b17c6955 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/index.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { wrapInI18nContext } from '../../../../kibana_services'; +import { wrapInI18nContext } from '../../../../../kibana_services'; import { ToolBarPagerText } from './tool_bar_pager_text'; import { ToolBarPagerButtons } from './tool_bar_pager_buttons'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/tool_bar_pager_buttons.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/tool_bar_pager_buttons.test.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/tool_bar_pager_buttons.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/tool_bar_pager_buttons.test.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/tool_bar_pager_buttons.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/tool_bar_pager_buttons.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/tool_bar_pager_buttons.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/tool_bar_pager_buttons.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/tool_bar_pager_text.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/tool_bar_pager_text.test.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/tool_bar_pager_text.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/tool_bar_pager_text.test.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/tool_bar_pager_text.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/tool_bar_pager_text.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/pager/tool_bar_pager_text.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/tool_bar_pager_text.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header.ts similarity index 96% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header.ts index 055f14f164476..a5cb9180333a4 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header.ts @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { wrapInI18nContext } from 'ui/i18n'; import { IUiSettingsClient } from 'kibana/public'; import { TableHeader } from './table_header/table_header'; +import { wrapInI18nContext } from '../../../../kibana_services'; export function createTableHeaderDirective(reactDirective: any, config: IUiSettingsClient) { return reactDirective( diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/__snapshots__/table_header.test.tsx.snap b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/__snapshots__/table_header.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/__snapshots__/table_header.test.tsx.snap rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/__snapshots__/table_header.test.tsx.snap diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/helpers.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/helpers.tsx similarity index 94% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/helpers.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/helpers.tsx index 80f963c8ccb3e..13833d724967a 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/helpers.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/helpers.tsx @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { IndexPattern } from '../../../../kibana_services'; +import { IndexPattern } from '../../../../../kibana_services'; // @ts-ignore -import { shortenDottedString } from '../../../../../../common/utils/shorten_dotted_string'; +import { shortenDottedString } from '../../../../../../../common/utils/shorten_dotted_string'; export type SortOrder = [string, 'asc' | 'desc']; export interface ColumnProps { diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/table_header.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/table_header.test.tsx similarity index 98% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/table_header.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/table_header.test.tsx index e5706b5e3c9bb..ef3d4ecc4b18f 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/table_header.test.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/table_header.test.tsx @@ -23,7 +23,7 @@ import { TableHeader } from './table_header'; // @ts-ignore import { findTestSubject } from '@elastic/eui/lib/test'; import { SortOrder } from './helpers'; -import { IndexPattern, IFieldType } from '../../../../kibana_services'; +import { IndexPattern, IFieldType } from '../../../../../kibana_services'; function getMockIndexPattern() { return ({ diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/table_header.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/table_header.tsx similarity index 96% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/table_header.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/table_header.tsx index 71674710ac855..17b961dbe6832 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/table_header.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/table_header.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { IndexPattern } from '../../../../kibana_services'; +import { IndexPattern } from '../../../../../kibana_services'; // @ts-ignore import { TableHeaderColumn } from './table_header_column'; import { SortOrder, getDisplayedColumns } from './helpers'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/table_header_column.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/table_header_column.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_header/table_header_column.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_header/table_header_column.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row.ts index 8ff4ab46ef532..8df035d098469 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row.ts @@ -24,15 +24,15 @@ import { IUiSettingsClient } from 'kibana/public'; import rison from 'rison-node'; import '../../doc_viewer'; // @ts-ignore -import { noWhiteSpace } from '../../../../../common/utils/no_white_space'; +import { noWhiteSpace } from '../../../../../../common/utils/no_white_space'; import openRowHtml from './table_row/open.html'; import detailsHtml from './table_row/details.html'; -import { dispatchRenderComplete } from '../../../../../../../../plugins/kibana_utils/public'; +import { dispatchRenderComplete } from '../../../../../../../../../plugins/kibana_utils/public'; import cellTemplateHtml from '../components/table_row/cell.html'; import truncateByHeightTemplateHtml from '../components/table_row/truncate_by_height.html'; -import { esFilters } from '../../../../../../../../plugins/data/public'; +import { esFilters } from '../../../../../../../../../plugins/data/public'; // guesstimate at the minimum number of chars wide cells in the table should be const MIN_LINE_LENGTH = 20; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/_cell.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/_cell.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/_cell.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/_cell.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/_details.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/_details.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/_details.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/_details.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/_index.scss new file mode 100644 index 0000000000000..c7ccdaa39ff65 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/_index.scss @@ -0,0 +1,3 @@ +@import 'cell'; +@import 'details'; +@import 'open'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/_open.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/_open.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/_open.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/_open.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/cell.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/cell.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/cell.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/cell.html diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/details.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/details.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/details.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/details.html diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/open.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/open.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/open.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/open.html diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/truncate_by_height.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/truncate_by_height.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/components/table_row/truncate_by_height.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/table_row/truncate_by_height.html diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/doc_table.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/doc_table.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/doc_table.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/doc_table.html diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/doc_table.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/doc_table.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/doc_table.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/doc_table.ts index 92ebc24c6e378..3329ffc7cd102 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/doc_table.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/doc_table.ts @@ -23,7 +23,7 @@ import html from './doc_table.html'; import './infinite_scroll'; import './components/table_header'; import './components/table_row'; -import { dispatchRenderComplete } from '../../../../../../../plugins/kibana_utils/public'; +import { dispatchRenderComplete } from '../../../../../../../../plugins/kibana_utils/public'; import './components/pager'; import './lib/pager'; // @ts-ignore diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/doc_table_strings.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/doc_table_strings.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/doc_table_strings.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/doc_table_strings.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/index.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/index.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/index.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/infinite_scroll.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/infinite_scroll.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/infinite_scroll.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/infinite_scroll.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/get_sort.d.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/get_sort.d.ts similarity index 92% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/get_sort.d.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/get_sort.d.ts index ebf715a64d939..0bf8a93a88367 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/get_sort.d.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/get_sort.d.ts @@ -17,7 +17,7 @@ * under the License. */ -import { IIndexPattern } from '../../../../../../../../plugins/data/public'; +import { IIndexPattern } from '../../../../../../../../../plugins/data/public'; import { SortOrder } from '../components/table_header/helpers'; export function getSort( diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/get_sort.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/get_sort.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/get_sort.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/get_sort.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/get_sort_for_search_source.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/get_sort_for_search_source.ts similarity index 96% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/get_sort_for_search_source.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/get_sort_for_search_source.ts index 952eadf7cbd94..26bba4589cf6a 100644 --- a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/get_sort_for_search_source.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/get_sort_for_search_source.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { IndexPattern } from '../../../kibana_services'; +import { IndexPattern } from '../../../../kibana_services'; import { SortOrder } from '../components/table_header/helpers'; import { getSort } from './get_sort'; diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/pager/index.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/pager/index.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/pager/index.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/pager/index.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/pager/pager.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/pager/pager.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/pager/pager.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/pager/pager.js diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/pager/pager_factory.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/pager/pager_factory.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_table/lib/pager/pager_factory.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/pager/pager_factory.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/doc_viewer.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_viewer.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/doc_viewer.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_viewer.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/get_painless_error.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/get_painless_error.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/get_painless_error.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/get_painless_error.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/angular/index.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/angular/index.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/angular/index.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/application.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/application.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/application.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/application.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/_index.scss new file mode 100644 index 0000000000000..0491430e5fddd --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/_index.scss @@ -0,0 +1,3 @@ +@import 'fetch_error/index'; +@import 'field_chooser/index'; +@import 'doc_viewer/index'; diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc/doc.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/doc.test.tsx similarity index 98% rename from src/legacy/core_plugins/kibana/public/discover/components/doc/doc.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/doc.test.tsx index 4df56483fa5c6..656e8598aa12f 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/doc/doc.test.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/doc.test.tsx @@ -28,7 +28,7 @@ jest.mock('../doc_viewer/doc_viewer', () => ({ DocViewer: 'test', })); -jest.mock('../../kibana_services', () => { +jest.mock('../../../kibana_services', () => { return { getServices: () => ({ metadata: { diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc/doc.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/doc.tsx similarity index 98% rename from src/legacy/core_plugins/kibana/public/discover/components/doc/doc.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/doc.tsx index 7020addb2bc6d..819eb9df592bd 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/doc/doc.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/doc.tsx @@ -22,7 +22,7 @@ import { EuiCallOut, EuiLink, EuiLoadingSpinner, EuiPageContent } from '@elastic import { IndexPatternsContract } from 'src/plugins/data/public'; import { DocViewer } from '../doc_viewer/doc_viewer'; import { ElasticRequestState, useEsDocSearch } from './use_es_doc_search'; -import { ElasticSearchHit, getServices } from '../../kibana_services'; +import { ElasticSearchHit, getServices } from '../../../kibana_services'; export interface ElasticSearchResult { hits: { diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc/use_es_doc_search.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/use_es_doc_search.test.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/doc/use_es_doc_search.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/use_es_doc_search.test.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc/use_es_doc_search.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/use_es_doc_search.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/components/doc/use_es_doc_search.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/use_es_doc_search.ts index 20bffe829de16..a40d9731a04f5 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/doc/use_es_doc_search.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/use_es_doc_search.ts @@ -17,7 +17,7 @@ * under the License. */ import { useEffect, useState } from 'react'; -import { ElasticSearchHit, IndexPattern } from '../../kibana_services'; +import { ElasticSearchHit, IndexPattern } from '../../../kibana_services'; import { DocProps } from './doc'; export enum ElasticRequestState { diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/__snapshots__/doc_viewer.test.tsx.snap b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/__snapshots__/doc_viewer.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/__snapshots__/doc_viewer.test.tsx.snap rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/__snapshots__/doc_viewer.test.tsx.snap diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/__snapshots__/doc_viewer_render_tab.test.tsx.snap b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/__snapshots__/doc_viewer_render_tab.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/__snapshots__/doc_viewer_render_tab.test.tsx.snap rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/__snapshots__/doc_viewer_render_tab.test.tsx.snap diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/_doc_viewer.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/_doc_viewer.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/_doc_viewer.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/_doc_viewer.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/_index.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/_index.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/_index.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.test.tsx similarity index 79% rename from src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.test.tsx index 158ed4ccc7759..c0644a6458694 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer.test.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.test.tsx @@ -21,33 +21,46 @@ import { mount, shallow } from 'enzyme'; import { DocViewer } from './doc_viewer'; // @ts-ignore import { findTestSubject } from '@elastic/eui/lib/test'; -import { - addDocView, - emptyDocViews, - DocViewRenderProps, - getDocViewsSorted as mockGetDocViewsSorted, -} from 'ui/registry/doc_views'; +import { DocViewRenderProps, DocViewInput, getServices } from '../../../kibana_services'; + +jest.mock('../../../kibana_services', () => { + const docViews: DocViewInput[] = []; + + function addDocView(docView: DocViewInput) { + docViews.push(docView); + } -jest.mock('../../kibana_services', () => { return { getServices: () => ({ docViewsRegistry: { - getDocViewsSorted: (hit: any) => { - return mockGetDocViewsSorted(hit); + getDocViewsSorted: () => { + return docViews; }, + addDocView, + docViews, }, }), + formatMsg: (x: any) => String(x), + formatStack: (x: any) => String(x), }; }); +const { + docViewsRegistry: { docViews, addDocView }, +} = getServices(); + +function emptyDocViews() { + docViews.length = 0; +} + beforeEach(() => { emptyDocViews(); jest.clearAllMocks(); }); test('Render with 3 different tabs', () => { - addDocView({ order: 20, title: 'React component', component: () =>
test
}); addDocView({ order: 10, title: 'Render function', render: jest.fn() }); + addDocView({ order: 20, title: 'React component', component: () =>
test
}); addDocView({ order: 30, title: 'Invalid doc view' }); const renderProps = { hit: {} } as DocViewRenderProps; diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.tsx similarity index 93% rename from src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.tsx index a2d58439ad031..00926d70db25c 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.tsx @@ -17,9 +17,8 @@ * under the License. */ import React from 'react'; -import { DocView } from 'ui/registry/doc_views_types'; import { EuiTabbedContent } from '@elastic/eui'; -import { getServices, DocViewRenderProps } from '../../kibana_services'; +import { getServices, DocViewRenderProps, DocView } from '../../../kibana_services'; import { DocViewerTab } from './doc_viewer_tab'; /** diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_render_error.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_error.tsx similarity index 94% rename from src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_render_error.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_error.tsx index 80b9cb5110db7..201ed562cfd6f 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_render_error.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_error.tsx @@ -18,8 +18,7 @@ */ import React from 'react'; import { EuiCallOut, EuiCodeBlock } from '@elastic/eui'; -// @ts-ignore -import { formatMsg, formatStack } from 'ui/notify/lib/index'; +import { formatMsg, formatStack } from '../../../kibana_services'; interface Props { error: Error | string | null; diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_render_tab.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.test.tsx similarity index 95% rename from src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_render_tab.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.test.tsx index 476d7cef159fb..c100e71b5f2b5 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_render_tab.test.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.test.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { mount } from 'enzyme'; import { DocViewRenderTab } from './doc_viewer_render_tab'; -import { DocViewRenderProps } from '../../kibana_services'; +import { DocViewRenderProps } from '../../../kibana_services'; test('Mounting and unmounting DocViewerRenderTab', () => { const unmountFn = jest.fn(); diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_render_tab.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.tsx similarity index 94% rename from src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_render_tab.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.tsx index 8ac11caefff90..31a8808a3a1c9 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_render_tab.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.tsx @@ -17,7 +17,7 @@ * under the License. */ import React, { useRef, useEffect } from 'react'; -import { DocViewRenderFn, DocViewRenderProps } from '../../kibana_services'; +import { DocViewRenderFn, DocViewRenderProps } from '../../../kibana_services'; interface Props { render: DocViewRenderFn; diff --git a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_tab.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_tab.tsx similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_tab.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_tab.tsx index 19558129eae8d..e08b0b2323d81 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_tab.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_tab.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; import { I18nProvider } from '@kbn/i18n/react'; -import { DocViewRenderProps, DocViewRenderFn } from '../../kibana_services'; +import { DocViewRenderProps, DocViewRenderFn } from '../../../kibana_services'; import { DocViewRenderTab } from './doc_viewer_render_tab'; import { DocViewerError } from './doc_viewer_render_error'; diff --git a/src/legacy/core_plugins/kibana/public/discover/components/fetch_error/_fetch_error.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/_fetch_error.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/fetch_error/_fetch_error.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/_fetch_error.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/components/fetch_error/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/_index.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/fetch_error/_index.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/_index.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/components/fetch_error/fetch_error.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/fetch_error.tsx similarity index 99% rename from src/legacy/core_plugins/kibana/public/discover/components/fetch_error/fetch_error.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/fetch_error.tsx index 8f67c1952f998..d2dda32f318fe 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/fetch_error/fetch_error.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/fetch_error.tsx @@ -19,7 +19,7 @@ import React, { Fragment } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiFlexGroup, EuiFlexItem, EuiCallOut, EuiCodeBlock, EuiSpacer } from '@elastic/eui'; -import { getAngularModule, wrapInI18nContext, getServices } from '../../kibana_services'; +import { getAngularModule, wrapInI18nContext, getServices } from '../../../kibana_services'; interface Props { fetchError: { diff --git a/src/legacy/core_plugins/kibana/public/discover/components/fetch_error/index.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/index.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/fetch_error/index.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/index.js diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/__snapshots__/discover_index_pattern.test.tsx.snap b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/__snapshots__/discover_index_pattern.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/__snapshots__/discover_index_pattern.test.tsx.snap rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/__snapshots__/discover_index_pattern.test.tsx.snap diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/_field_chooser.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/_field_chooser.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/_field_chooser.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/_field_chooser.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/_index.scss new file mode 100644 index 0000000000000..91daed8ea048e --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/_index.scss @@ -0,0 +1 @@ +@import 'field_chooser'; diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/change_indexpattern.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/change_indexpattern.tsx new file mode 100644 index 0000000000000..60842ac81ee03 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/change_indexpattern.tsx @@ -0,0 +1,122 @@ +/* + * 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. + */ + +import { i18n } from '@kbn/i18n'; +import React, { useState } from 'react'; +import { + EuiButtonEmpty, + EuiPopover, + EuiPopoverTitle, + EuiSelectable, + EuiButtonEmptyProps, +} from '@elastic/eui'; +import { EuiSelectableProps } from '@elastic/eui/src/components/selectable/selectable'; +import { IndexPatternRef } from './types'; + +export type ChangeIndexPatternTriggerProps = EuiButtonEmptyProps & { + label: string; + title?: string; +}; + +// TODO: refactor to shared component with ../../../../../../../../x-pack/legacy/plugins/lens/public/indexpattern_plugin/change_indexpattern + +export function ChangeIndexPattern({ + indexPatternRefs, + indexPatternId, + onChangeIndexPattern, + trigger, + selectableProps, +}: { + trigger: ChangeIndexPatternTriggerProps; + indexPatternRefs: IndexPatternRef[]; + onChangeIndexPattern: (newId: string) => void; + indexPatternId?: string; + selectableProps?: EuiSelectableProps; +}) { + const [isPopoverOpen, setPopoverIsOpen] = useState(false); + + const createTrigger = function() { + const { label, title, ...rest } = trigger; + return ( + setPopoverIsOpen(!isPopoverOpen)} + {...rest} + > + {label} + + ); + }; + + return ( + setPopoverIsOpen(false)} + className="eui-textTruncate" + anchorClassName="eui-textTruncate" + display="block" + panelPaddingSize="s" + ownFocus + > +
+ + {i18n.translate('kbn.discover.fieldChooser.indexPattern.changeIndexPatternTitle', { + defaultMessage: 'Change index pattern', + })} + + ({ + label: title, + key: id, + value: id, + checked: id === indexPatternId ? 'on' : undefined, + }))} + onChange={choices => { + const choice = (choices.find(({ checked }) => checked) as unknown) as { + value: string; + }; + onChangeIndexPattern(choice.value); + setPopoverIsOpen(false); + }} + searchProps={{ + compressed: true, + ...(selectableProps ? selectableProps.searchProps : undefined), + }} + > + {(list, search) => ( + <> + {search} + {list} + + )} + +
+
+ ); +} diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field.html diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field.js index 0d2d0788dd175..f7f219a287492 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field.js @@ -20,10 +20,8 @@ import $ from 'jquery'; import _ from 'lodash'; import { i18n } from '@kbn/i18n'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../../../kibana_services'; import html from './discover_field.html'; -import 'ui/directives/css_truncate'; -import 'ui/directives/field_name'; import './string_progress_bar'; import detailsHtml from './lib/detail_views/string.html'; diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field_search.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field_search.test.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field_search.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field_search.test.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field_search.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field_search.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field_search.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field_search.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field_search_directive.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field_search_directive.ts similarity index 94% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field_search_directive.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field_search_directive.ts index 69865ec424325..6d570349ee0c6 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field_search_directive.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field_search_directive.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { wrapInI18nContext } from '../../kibana_services'; +import { wrapInI18nContext } from '../../../kibana_services'; import { DiscoverFieldSearch } from './discover_field_search'; export function createFieldSearchDirective(reactDirective: any) { diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_index_pattern.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_index_pattern.test.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_index_pattern.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_index_pattern.test.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_index_pattern.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_index_pattern.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_index_pattern.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_index_pattern.tsx diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_index_pattern_directive.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_index_pattern_directive.ts similarity index 95% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_index_pattern_directive.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_index_pattern_directive.ts index 46c8fa854847a..8bbeac086f093 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_index_pattern_directive.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_index_pattern_directive.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { wrapInI18nContext } from '../../kibana_services'; +import { wrapInI18nContext } from '../../../kibana_services'; import { DiscoverIndexPattern } from './discover_index_pattern'; export function createIndexPatternSelectDirective(reactDirective: any) { diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/field_chooser.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/field_chooser.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/field_chooser.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/field_chooser.html diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/field_chooser.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/field_chooser.js similarity index 99% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/field_chooser.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/field_chooser.js index cf636a1675eb0..47b3ec6b07e8e 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/field_chooser.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/field_chooser.js @@ -23,7 +23,7 @@ import { fieldCalculator } from './lib/field_calculator'; import './discover_field'; import './discover_field_search_directive'; import './discover_index_pattern_directive'; -import { FieldList } from '../../../../../../../plugins/data/public'; +import { FieldList } from '../../../../../../../../plugins/data/public'; import fieldChooserTemplate from './field_chooser.html'; export function createFieldChooserDirective($location, config, $route) { diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/lib/detail_views/string.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/lib/detail_views/string.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/lib/detail_views/string.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/lib/detail_views/string.html diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/lib/field_calculator.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/lib/field_calculator.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/lib/field_calculator.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/lib/field_calculator.js diff --git a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/string_progress_bar.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/string_progress_bar.tsx similarity index 96% rename from src/legacy/core_plugins/kibana/public/discover/components/field_chooser/string_progress_bar.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/string_progress_bar.tsx index 7e4fc79839a52..0c5e7fa69357d 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/field_chooser/string_progress_bar.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/string_progress_bar.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiProgress, EuiText, EuiToolTip } from '@elastic/eui'; -import { wrapInI18nContext } from '../../kibana_services'; +import { wrapInI18nContext } from '../../../kibana_services'; interface Props { percent: number; diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/types.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/types.ts new file mode 100644 index 0000000000000..302bf5165777c --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/types.ts @@ -0,0 +1,23 @@ +/* + * 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 interface IndexPatternRef { + id: string; + title: string; +} diff --git a/src/legacy/core_plugins/kibana/public/discover/components/help_menu/help_menu_util.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/help_menu/help_menu_util.js similarity index 95% rename from src/legacy/core_plugins/kibana/public/discover/components/help_menu/help_menu_util.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/help_menu/help_menu_util.js index eb40130137e00..37fa79b490d56 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/help_menu/help_menu_util.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/help_menu/help_menu_util.js @@ -18,7 +18,7 @@ */ import { i18n } from '@kbn/i18n'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../../../kibana_services'; const { docLinks } = getServices(); export function addHelpMenuToAppChrome(chrome) { diff --git a/src/legacy/core_plugins/kibana/public/discover/components/top_nav/__snapshots__/open_search_panel.test.js.snap b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/__snapshots__/open_search_panel.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/components/top_nav/__snapshots__/open_search_panel.test.js.snap rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/__snapshots__/open_search_panel.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/discover/components/top_nav/open_search_panel.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/open_search_panel.js similarity index 95% rename from src/legacy/core_plugins/kibana/public/discover/components/top_nav/open_search_panel.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/open_search_panel.js index ec1763f44f25f..ebe4cbb1ddb69 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/top_nav/open_search_panel.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/open_search_panel.js @@ -32,8 +32,8 @@ import { EuiFlyoutBody, EuiTitle, } from '@elastic/eui'; -import { SavedObjectFinderUi } from '../../../../../../../plugins/kibana_react/public'; -import { getServices } from '../../kibana_services'; +import { SavedObjectFinderUi } from '../../../../../../../../plugins/kibana_react/public'; +import { getServices } from '../../../kibana_services'; const SEARCH_OBJECT_TYPE = 'search'; diff --git a/src/legacy/core_plugins/kibana/public/discover/components/top_nav/open_search_panel.test.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/open_search_panel.test.js similarity index 96% rename from src/legacy/core_plugins/kibana/public/discover/components/top_nav/open_search_panel.test.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/open_search_panel.test.js index 22487421bf61b..c8f2ca220386d 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/top_nav/open_search_panel.test.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/open_search_panel.test.js @@ -20,7 +20,7 @@ import React from 'react'; import { shallow } from 'enzyme'; -jest.mock('../../kibana_services', () => { +jest.mock('../../../kibana_services', () => { return { getServices: () => ({ core: { uiSettings: {}, savedObjects: {} }, diff --git a/src/legacy/core_plugins/kibana/public/discover/components/top_nav/show_open_search_panel.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/show_open_search_panel.js similarity index 93% rename from src/legacy/core_plugins/kibana/public/discover/components/top_nav/show_open_search_panel.js rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/show_open_search_panel.js index 4beee3c02fa6f..e40d700b48885 100644 --- a/src/legacy/core_plugins/kibana/public/discover/components/top_nav/show_open_search_panel.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/show_open_search_panel.js @@ -20,11 +20,10 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { OpenSearchPanel } from './open_search_panel'; -import { I18nContext } from 'ui/i18n'; let isOpen = false; -export function showOpenSearchPanel({ makeUrl }) { +export function showOpenSearchPanel({ makeUrl, I18nContext }) { if (isOpen) { return; } diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/_embeddables.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/_embeddables.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/embeddable/_embeddables.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/_embeddables.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/_index.scss b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/_index.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/embeddable/_index.scss rename to src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/_index.scss diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/constants.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/constants.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/embeddable/constants.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/constants.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/index.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/embeddable/index.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/index.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_embeddable.ts similarity index 98% rename from src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_embeddable.ts index 273c7d80f216c..14f7057045251 100644 --- a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_embeddable.ts @@ -21,7 +21,6 @@ import * as Rx from 'rxjs'; import { Subscription } from 'rxjs'; import { i18n } from '@kbn/i18n'; import { TExecuteTriggerActions } from 'src/plugins/ui_actions/public'; -import { SearchSourceContract } from '../../../../../ui/public/courier'; import { esFilters, TimeRange, @@ -31,12 +30,12 @@ import { getTime, Query, IFieldType, -} from '../../../../../../plugins/data/public'; +} from '../../../../../../../plugins/data/public'; import { APPLY_FILTER_TRIGGER, Container, Embeddable, -} from '../../../../embeddable_api/public/np_ready/public'; +} from '../../../../../embeddable_api/public/np_ready/public'; import * as columnActions from '../angular/doc_table/actions/columns'; import { SavedSearch } from '../types'; import searchTemplate from './search_template.html'; @@ -51,7 +50,8 @@ import { getServices, IndexPattern, RequestAdapter, -} from '../kibana_services'; + SearchSourceContract, +} from '../../kibana_services'; import { SEARCH_EMBEDDABLE_TYPE } from './constants'; interface SearchScope extends ng.IScope { diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_embeddable_factory.ts similarity index 94% rename from src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_embeddable_factory.ts index b5475b2629c70..3226b3af93cee 100644 --- a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_embeddable_factory.ts @@ -18,15 +18,14 @@ */ import { i18n } from '@kbn/i18n'; import { TExecuteTriggerActions } from 'src/plugins/ui_actions/public'; -import { IInjector } from 'ui/chrome'; -import { getServices } from '../kibana_services'; +import { getServices, IInjector } from '../../kibana_services'; import { EmbeddableFactory, ErrorEmbeddable, Container, -} from '../../../../../../plugins/embeddable/public'; +} from '../../../../../../../plugins/embeddable/public'; -import { TimeRange } from '../../../../../../plugins/data/public'; +import { TimeRange } from '../../../../../../../plugins/data/public'; import { SearchEmbeddable } from './search_embeddable'; import { SearchInput, SearchOutput } from './types'; import { SEARCH_EMBEDDABLE_TYPE } from './constants'; diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/search_template.html b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_template.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/embeddable/search_template.html rename to src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_template.html diff --git a/src/legacy/core_plugins/kibana/public/discover/embeddable/types.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/types.ts similarity index 92% rename from src/legacy/core_plugins/kibana/public/discover/embeddable/types.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/types.ts index adfa3d5acbf7a..3d6acb0963bed 100644 --- a/src/legacy/core_plugins/kibana/public/discover/embeddable/types.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/types.ts @@ -20,7 +20,12 @@ import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from 'src/plugins/embeddable/public'; import { SavedSearch } from '../types'; import { SortOrder } from '../angular/doc_table/components/table_header/helpers'; -import { esFilters, IIndexPattern, TimeRange, Query } from '../../../../../../plugins/data/public'; +import { + esFilters, + IIndexPattern, + TimeRange, + Query, +} from '../../../../../../../plugins/data/public'; export interface SearchInput extends EmbeddableInput { timeRange: TimeRange; diff --git a/src/legacy/core_plugins/kibana/public/discover/helpers/breadcrumbs.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/helpers/breadcrumbs.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/discover/helpers/breadcrumbs.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/helpers/breadcrumbs.ts diff --git a/src/legacy/core_plugins/kibana/public/discover/helpers/get_index_pattern_id.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/helpers/get_index_pattern_id.ts similarity index 95% rename from src/legacy/core_plugins/kibana/public/discover/helpers/get_index_pattern_id.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/helpers/get_index_pattern_id.ts index bd62460fd6868..8f4d1b28624a4 100644 --- a/src/legacy/core_plugins/kibana/public/discover/helpers/get_index_pattern_id.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/helpers/get_index_pattern_id.ts @@ -17,7 +17,7 @@ * under the License. */ -import { IIndexPattern } from '../../../../../../plugins/data/common/index_patterns'; +import { IIndexPattern } from '../../../../../../../plugins/data/common/index_patterns'; export function findIndexPatternById( indexPatterns: IIndexPattern[], diff --git a/src/legacy/core_plugins/kibana/public/discover/helpers/register_feature.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/register_feature.ts similarity index 58% rename from src/legacy/core_plugins/kibana/public/discover/helpers/register_feature.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/register_feature.ts index eb8c2aec91558..74255642ab2c9 100644 --- a/src/legacy/core_plugins/kibana/public/discover/helpers/register_feature.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/register_feature.ts @@ -18,24 +18,22 @@ */ import { i18n } from '@kbn/i18n'; import { - FeatureCatalogueRegistryProvider, FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; + HomePublicPluginSetup, +} from '../../../../../../plugins/home/public'; -export function registerFeature() { - FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'discover', - title: i18n.translate('kbn.discover.discoverTitle', { - defaultMessage: 'Discover', - }), - description: i18n.translate('kbn.discover.discoverDescription', { - defaultMessage: 'Interactively explore your data by querying and filtering raw documents.', - }), - icon: 'discoverApp', - path: '/app/kibana#/discover', - showOnHomePage: true, - category: FeatureCatalogueCategory.DATA, - }; +export function registerFeature(home: HomePublicPluginSetup) { + home.featureCatalogue.register({ + id: 'discover', + title: i18n.translate('kbn.discover.discoverTitle', { + defaultMessage: 'Discover', + }), + description: i18n.translate('kbn.discover.discoverDescription', { + defaultMessage: 'Interactively explore your data by querying and filtering raw documents.', + }), + icon: 'discoverApp', + path: '/app/kibana#/discover', + showOnHomePage: true, + category: FeatureCatalogueCategory.DATA, }); } diff --git a/src/legacy/core_plugins/kibana/public/discover/types.d.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/types.d.ts similarity index 94% rename from src/legacy/core_plugins/kibana/public/discover/types.d.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/types.d.ts index 6cdd802fa2800..c8920e351fcca 100644 --- a/src/legacy/core_plugins/kibana/public/discover/types.d.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/types.d.ts @@ -17,7 +17,7 @@ * under the License. */ -import { SearchSourceContract } from '../../../../ui/public/courier'; +import { SearchSourceContract } from '../kibana_services'; import { SortOrder } from './angular/doc_table/components/table_header/helpers'; export { SortOrder } from './angular/doc_table/components/table_header/helpers'; diff --git a/src/legacy/core_plugins/kibana/public/discover/plugin.ts b/src/legacy/core_plugins/kibana/public/discover/plugin.ts index b5a8e25dc11ea..0cff1e66f3636 100644 --- a/src/legacy/core_plugins/kibana/public/discover/plugin.ts +++ b/src/legacy/core_plugins/kibana/public/discover/plugin.ts @@ -20,16 +20,17 @@ import { AppMountParameters, CoreSetup, CoreStart, Plugin } from 'kibana/public' import angular from 'angular'; import { IUiActionsStart } from 'src/plugins/ui_actions/public'; import { DataPublicPluginStart } from 'src/plugins/data/public'; -import { registerFeature } from './helpers/register_feature'; +import { registerFeature } from './np_ready/register_feature'; import './kibana_services'; import { IEmbeddableStart, IEmbeddableSetup } from '../../../../../plugins/embeddable/public'; import { getInnerAngularModule, getInnerAngularModuleEmbeddable } from './get_inner_angular'; import { setAngularModule, setServices } from './kibana_services'; import { NavigationPublicPluginStart as NavigationStart } from '../../../../../plugins/navigation/public'; import { EuiUtilsStart } from '../../../../../plugins/eui_utils/public'; -import { buildServices } from './helpers/build_services'; +import { buildServices } from './build_services'; import { SharePluginStart } from '../../../../../plugins/share/public'; import { KibanaLegacySetup } from '../../../../../plugins/kibana_legacy/public'; +import { HomePublicPluginSetup } from '../../../../../plugins/home/public'; /** * These are the interfaces with your public contracts. You should export these @@ -42,6 +43,7 @@ export interface DiscoverSetupPlugins { uiActions: IUiActionsStart; embeddable: IEmbeddableSetup; kibana_legacy: KibanaLegacySetup; + home: HomePublicPluginSetup; } export interface DiscoverStartPlugins { uiActions: IUiActionsStart; @@ -84,10 +86,11 @@ export class DiscoverPlugin implements Plugin { } await this.initializeServices(); await this.initializeInnerAngular(); - const { renderApp } = await import('./application'); + const { renderApp } = await import('./np_ready/application'); return renderApp(innerAngularName, params.element); }, }); + registerFeature(plugins.home); } start(core: CoreStart, plugins: DiscoverStartPlugins): DiscoverStart { @@ -115,14 +118,13 @@ export class DiscoverPlugin implements Plugin { }; this.registerEmbeddable(core, plugins); - registerFeature(); } /** * register embeddable with a slimmer embeddable version of inner angular */ private async registerEmbeddable(core: CoreStart, plugins: DiscoverStartPlugins) { - const { SearchEmbeddableFactory } = await import('./embeddable'); + const { SearchEmbeddableFactory } = await import('./np_ready/embeddable'); const getInjector = async () => { if (!this.initializeServices) { throw Error('Discover plugin registerEmbeddable: initializeServices is undefined'); diff --git a/src/legacy/core_plugins/kibana/public/home/_index.scss b/src/legacy/core_plugins/kibana/public/home/_index.scss index 192091fb04e3c..f42254c1096ce 100644 --- a/src/legacy/core_plugins/kibana/public/home/_index.scss +++ b/src/legacy/core_plugins/kibana/public/home/_index.scss @@ -1 +1 @@ -@import './components/index'; +@import 'np_ready/components/index'; diff --git a/src/legacy/core_plugins/kibana/public/home/render_app.tsx b/src/legacy/core_plugins/kibana/public/home/np_ready/application.tsx similarity index 96% rename from src/legacy/core_plugins/kibana/public/home/render_app.tsx rename to src/legacy/core_plugins/kibana/public/home/np_ready/application.tsx index a8c35144a45b0..8345491d99972 100644 --- a/src/legacy/core_plugins/kibana/public/home/render_app.tsx +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/application.tsx @@ -22,7 +22,7 @@ import { render, unmountComponentAtNode } from 'react-dom'; import { i18n } from '@kbn/i18n'; // @ts-ignore import { HomeApp } from './components/home_app'; -import { getServices } from './kibana_services'; +import { getServices } from '../kibana_services'; export const renderApp = async (element: HTMLElement) => { const homeTitle = i18n.translate('kbn.home.breadcrumbs.homeTitle', { defaultMessage: 'Home' }); diff --git a/src/legacy/core_plugins/kibana/public/home/components/__snapshots__/add_data.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/add_data.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/__snapshots__/add_data.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/add_data.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/__snapshots__/home.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/home.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/__snapshots__/home.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/home.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/__snapshots__/recently_accessed.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/recently_accessed.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/__snapshots__/recently_accessed.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/recently_accessed.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/__snapshots__/sample_data_view_data_button.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/sample_data_view_data_button.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/__snapshots__/sample_data_view_data_button.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/sample_data_view_data_button.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/__snapshots__/synopsis.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/synopsis.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/__snapshots__/synopsis.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/synopsis.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/__snapshots__/welcome.test.tsx.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/welcome.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/__snapshots__/welcome.test.tsx.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/welcome.test.tsx.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/_add_data.scss b/src/legacy/core_plugins/kibana/public/home/np_ready/components/_add_data.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/_add_data.scss rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/_add_data.scss diff --git a/src/legacy/core_plugins/kibana/public/home/components/_home.scss b/src/legacy/core_plugins/kibana/public/home/np_ready/components/_home.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/_home.scss rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/_home.scss diff --git a/src/legacy/core_plugins/kibana/public/home/components/_index.scss b/src/legacy/core_plugins/kibana/public/home/np_ready/components/_index.scss similarity index 52% rename from src/legacy/core_plugins/kibana/public/home/components/_index.scss rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/_index.scss index af23752e54287..870099ffb350e 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/_index.scss +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/_index.scss @@ -5,10 +5,10 @@ // homChart__legend--small // homChart__legend-isLoading -@import './add_data'; -@import './home'; -@import './sample_data_set_cards'; -@import './synopsis'; -@import './welcome'; +@import 'add_data'; +@import 'home'; +@import 'sample_data_set_cards'; +@import 'synopsis'; +@import 'welcome'; -@import './tutorial/tutorial'; +@import 'tutorial/tutorial'; diff --git a/src/legacy/core_plugins/kibana/public/home/components/_sample_data_set_cards.scss b/src/legacy/core_plugins/kibana/public/home/np_ready/components/_sample_data_set_cards.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/_sample_data_set_cards.scss rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/_sample_data_set_cards.scss diff --git a/src/legacy/core_plugins/kibana/public/home/components/_synopsis.scss b/src/legacy/core_plugins/kibana/public/home/np_ready/components/_synopsis.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/_synopsis.scss rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/_synopsis.scss diff --git a/src/legacy/core_plugins/kibana/public/home/components/_welcome.scss b/src/legacy/core_plugins/kibana/public/home/np_ready/components/_welcome.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/_welcome.scss rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/_welcome.scss diff --git a/src/legacy/core_plugins/kibana/public/home/components/add_data.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.js similarity index 99% rename from src/legacy/core_plugins/kibana/public/home/components/add_data.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.js index 8ea9d78507ceb..a49620be2d229 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/add_data.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.js @@ -21,7 +21,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; -import { getServices } from '../kibana_services'; +import { getServices } from '../../kibana_services'; import { EuiButton, diff --git a/src/legacy/core_plugins/kibana/public/home/components/add_data.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.test.js similarity index 95% rename from src/legacy/core_plugins/kibana/public/home/components/add_data.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.test.js index 9457f766409b8..86eec564f0b61 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/add_data.test.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.test.js @@ -20,9 +20,9 @@ import React from 'react'; import { AddData } from './add_data'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { getServices } from '../kibana_services'; +import { getServices } from '../../kibana_services'; -jest.mock('../kibana_services', () => { +jest.mock('../../kibana_services', () => { const mock = { getBasePath: jest.fn(() => 'path'), }; diff --git a/src/legacy/core_plugins/kibana/public/home/components/feature_directory.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/feature_directory.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/home/components/feature_directory.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/feature_directory.js index 447a54bd89701..5545944a1029f 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/feature_directory.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/feature_directory.js @@ -31,7 +31,7 @@ import { EuiSpacer, } from '@elastic/eui'; -import { FeatureCatalogueCategory } from 'ui/registry/feature_catalogue'; +import { FeatureCatalogueCategory } from '../../../../../../../plugins/home/public'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; diff --git a/src/legacy/core_plugins/kibana/public/home/components/home.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/home/components/home.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/home.js index d552dd070c86d..5c32a463da115 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/home.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.js @@ -38,8 +38,8 @@ import { } from '@elastic/eui'; import { Welcome } from './welcome'; -import { FeatureCatalogueCategory } from 'ui/registry/feature_catalogue'; -import { getServices } from '../kibana_services'; +import { FeatureCatalogueCategory } from '../../../../../../../plugins/home/public'; +import { getServices } from '../../kibana_services'; const KEY_ENABLE_WELCOME = 'home:welcome:show'; diff --git a/src/legacy/core_plugins/kibana/public/home/components/home.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/home/components/home.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.js index 1f46cf2875fee..be2ceb66f69d0 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/home.test.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.js @@ -23,9 +23,10 @@ import React from 'react'; import sinon from 'sinon'; import { shallow } from 'enzyme'; import { Home } from './home'; -import { FeatureCatalogueCategory } from 'ui/registry/feature_catalogue'; -jest.mock('../kibana_services', () => ({ +import { FeatureCatalogueCategory } from '../../../../../../../plugins/home/public'; + +jest.mock('../../kibana_services', () => ({ getServices: () => ({ getBasePath: () => 'path', getInjected: () => '', diff --git a/src/legacy/core_plugins/kibana/public/home/components/home.test.mocks.ts b/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.mocks.ts similarity index 96% rename from src/legacy/core_plugins/kibana/public/home/components/home.test.mocks.ts rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.mocks.ts index cd7bc82fe3345..a0b9d7c779b02 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/home.test.mocks.ts +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.mocks.ts @@ -22,7 +22,7 @@ import { overlayServiceMock, httpServiceMock, injectedMetadataServiceMock, -} from '../../../../../../core/public/mocks'; +} from '../../../../../../../core/public/mocks'; jest.doMock('ui/new_platform', () => { return { diff --git a/src/legacy/core_plugins/kibana/public/home/components/home_app.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/home_app.js similarity index 96% rename from src/legacy/core_plugins/kibana/public/home/components/home_app.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/home_app.js index 29f24f5b841a3..6532737cc02e8 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/home_app.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/home_app.js @@ -27,7 +27,9 @@ import { Tutorial } from './tutorial/tutorial'; import { HashRouter as Router, Switch, Route, Redirect } from 'react-router-dom'; import { getTutorial } from '../load_tutorials'; import { replaceTemplateStrings } from './tutorial/replace_template_strings'; -import { getServices } from '../kibana_services'; +import { getServices } from '../../kibana_services'; +// TODO This is going to be refactored soon +// eslint-disable-next-line @kbn/eslint/no-restricted-paths import { npSetup } from 'ui/new_platform'; export function HomeApp({ directories }) { const { diff --git a/src/legacy/core_plugins/kibana/public/home/components/recently_accessed.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/recently_accessed.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/recently_accessed.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.test.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/recently_accessed.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.test.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/sample_data/index.tsx b/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data/index.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/sample_data/index.tsx rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data/index.tsx diff --git a/src/legacy/core_plugins/kibana/public/home/components/sample_data_set_card.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_card.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/sample_data_set_card.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_card.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/sample_data_set_cards.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_cards.js similarity index 99% rename from src/legacy/core_plugins/kibana/public/home/components/sample_data_set_cards.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_cards.js index 7daf10e5f01f8..198e0d95271d7 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/sample_data_set_cards.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_cards.js @@ -24,7 +24,7 @@ import { EuiFlexGrid, EuiFlexItem } from '@elastic/eui'; import { SampleDataSetCard, INSTALLED_STATUS, UNINSTALLED_STATUS } from './sample_data_set_card'; -import { getServices } from '../kibana_services'; +import { getServices } from '../../kibana_services'; import { listSampleDataSets, diff --git a/src/legacy/core_plugins/kibana/public/home/components/sample_data_view_data_button.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/home/components/sample_data_view_data_button.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.js index c9bd32a7d14d5..e6f5c07c94f9f 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/sample_data_view_data_button.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.js @@ -22,7 +22,7 @@ import PropTypes from 'prop-types'; import { EuiButton, EuiContextMenu, EuiIcon, EuiPopover } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { getServices } from '../kibana_services'; +import { getServices } from '../../kibana_services'; export class SampleDataViewDataButton extends React.Component { addBasePath = getServices().addBasePath; diff --git a/src/legacy/core_plugins/kibana/public/home/components/sample_data_view_data_button.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.test.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/components/sample_data_view_data_button.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.test.js index f594ec1264c94..e33c206ed8482 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/sample_data_view_data_button.test.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.test.js @@ -22,7 +22,7 @@ import { shallow } from 'enzyme'; import { SampleDataViewDataButton } from './sample_data_view_data_button'; -jest.mock('../kibana_services', () => ({ +jest.mock('../../kibana_services', () => ({ getServices: () => ({ addBasePath: path => `root${path}`, }), diff --git a/src/legacy/core_plugins/kibana/public/home/components/synopsis.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/synopsis.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/synopsis.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/synopsis.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/synopsis.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/synopsis.test.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/synopsis.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/synopsis.test.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/content.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/content.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/content.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/content.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/footer.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/footer.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/footer.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/footer.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/instruction_set.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/instruction_set.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/instruction_set.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/instruction_set.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/introduction.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/introduction.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/introduction.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/introduction.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/tutorial.test.js.snap b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/tutorial.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/__snapshots__/tutorial.test.js.snap rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/tutorial.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/_tutorial.scss b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/_tutorial.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/_tutorial.scss rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/_tutorial.scss diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/content.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.js similarity index 94% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/content.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.js index db1f55b503e84..669eb6c4c42cd 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/tutorial/content.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.js @@ -19,7 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Markdown } from '../../../../../kibana_react/public'; +import { Markdown } from '../../../../../../kibana_react/public'; const whiteListedRules = ['backticks', 'emphasis', 'link', 'list']; diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/content.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.test.js similarity index 95% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/content.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.test.js index d3a4d7085a0aa..64864b6a5404d 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/tutorial/content.test.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.test.js @@ -22,7 +22,7 @@ import { shallow } from 'enzyme'; import { Content } from './content'; -jest.mock('../../../../../kibana_react/public', () => { +jest.mock('../../../../../../kibana_react/public', () => { return { Markdown: () =>
, }; diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/footer.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/footer.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/footer.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.test.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/footer.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.test.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/instruction.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/instruction.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/instruction_set.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.js similarity index 99% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/instruction_set.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.js index 41378cfbb63e6..f80a8e59faaad 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/tutorial/instruction_set.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.js @@ -22,7 +22,7 @@ import PropTypes from 'prop-types'; import { Instruction } from './instruction'; import { ParameterForm } from './parameter_form'; import { Content } from './content'; -import { getDisplayText } from '../../../../common/tutorials/instruction_variant'; +import { getDisplayText } from '../../../../../common/tutorials/instruction_variant'; import { EuiTabs, EuiTab, diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/instruction_set.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.test.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/instruction_set.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.test.js index 6c9ce530f6b20..21c3ddeceff6b 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/tutorial/instruction_set.test.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.test.js @@ -45,7 +45,7 @@ const instructionVariants = [ }, ]; -jest.mock('../../../../../kibana_react/public', () => { +jest.mock('../../../../../../kibana_react/public', () => { return { Markdown: () =>
, }; diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/introduction.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/introduction.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/introduction.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.test.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/introduction.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.test.js index ae87bc6030c9a..8862ef7334f93 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/tutorial/introduction.test.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.test.js @@ -22,7 +22,7 @@ import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import { Introduction } from './introduction'; -jest.mock('../../../../../kibana_react/public', () => { +jest.mock('../../../../../../kibana_react/public', () => { return { Markdown: () =>
, }; diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/number_parameter.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/number_parameter.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/number_parameter.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/number_parameter.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/parameter_form.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/parameter_form.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/parameter_form.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/parameter_form.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/replace_template_strings.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/replace_template_strings.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/replace_template_strings.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/replace_template_strings.js index 62116ae1a0663..daf996444eb3c 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/tutorial/replace_template_strings.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/replace_template_strings.js @@ -18,7 +18,7 @@ */ import { Writer } from 'mustache'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../../../kibana_services'; const TEMPLATE_TAGS = ['{', '}']; diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/saved_objects_installer.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/saved_objects_installer.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/saved_objects_installer.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.test.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/saved_objects_installer.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.test.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/status_check_states.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/status_check_states.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/status_check_states.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/status_check_states.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/string_parameter.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/string_parameter.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/string_parameter.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/string_parameter.js diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/tutorial.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.js similarity index 99% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/tutorial.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.js index 08c166af580b0..68b1371dde1f9 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/tutorial/tutorial.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.js @@ -37,7 +37,7 @@ import { import * as StatusCheckStates from './status_check_states'; import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../../../kibana_services'; const INSTRUCTIONS_TYPE = { ELASTIC_CLOUD: 'elasticCloud', diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial/tutorial.test.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.test.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial/tutorial.test.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.test.js index 41d83d7562f6e..733223fe79046 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/tutorial/tutorial.test.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.test.js @@ -22,7 +22,7 @@ import { shallowWithIntl, mountWithIntl } from 'test_utils/enzyme_helpers'; import { Tutorial } from './tutorial'; -jest.mock('../../kibana_services', () => ({ +jest.mock('../../../kibana_services', () => ({ getServices: () => ({ getBasePath: jest.fn(() => 'path'), chrome: { @@ -30,7 +30,7 @@ jest.mock('../../kibana_services', () => ({ }, }), })); -jest.mock('../../../../../kibana_react/public', () => { +jest.mock('../../../../../../kibana_react/public', () => { return { Markdown: () =>
, }; diff --git a/src/legacy/core_plugins/kibana/public/home/components/tutorial_directory.js b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial_directory.js similarity index 99% rename from src/legacy/core_plugins/kibana/public/home/components/tutorial_directory.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial_directory.js index 13152124ea4b8..9d4ea4afecf3c 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/tutorial_directory.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial_directory.js @@ -22,7 +22,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Synopsis } from './synopsis'; import { SampleDataSetCards } from './sample_data_set_cards'; -import { getServices } from '../kibana_services'; +import { getServices } from '../../kibana_services'; import { EuiPage, diff --git a/src/legacy/core_plugins/kibana/public/home/components/welcome.test.tsx b/src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.test.tsx similarity index 98% rename from src/legacy/core_plugins/kibana/public/home/components/welcome.test.tsx rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.test.tsx index 42c6e6ff6056a..28bdab14193c4 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/welcome.test.tsx +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.test.tsx @@ -21,7 +21,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { Welcome } from './welcome'; -jest.mock('../kibana_services', () => ({ +jest.mock('../../kibana_services', () => ({ getServices: () => ({ addBasePath: (path: string) => `root${path}`, trackUiMetric: () => {}, diff --git a/src/legacy/core_plugins/kibana/public/home/components/welcome.tsx b/src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.tsx similarity index 99% rename from src/legacy/core_plugins/kibana/public/home/components/welcome.tsx rename to src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.tsx index 435bf98ca7840..9bbb7aaceb915 100644 --- a/src/legacy/core_plugins/kibana/public/home/components/welcome.tsx +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.tsx @@ -36,7 +36,7 @@ import { EuiPortal, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { getServices } from '../kibana_services'; +import { getServices } from '../../kibana_services'; import { SampleDataCard } from './sample_data'; interface Props { diff --git a/src/legacy/core_plugins/kibana/public/home/load_tutorials.js b/src/legacy/core_plugins/kibana/public/home/np_ready/load_tutorials.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/home/load_tutorials.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/load_tutorials.js index be84027296259..6a0a01ebda8db 100644 --- a/src/legacy/core_plugins/kibana/public/home/load_tutorials.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/load_tutorials.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import { getServices } from './kibana_services'; +import { getServices } from '../kibana_services'; import { i18n } from '@kbn/i18n'; const baseUrlLP = getServices().addBasePath('/api/kibana/home/tutorials_LP'); diff --git a/src/legacy/core_plugins/kibana/public/home/sample_data_client.js b/src/legacy/core_plugins/kibana/public/home/np_ready/sample_data_client.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/sample_data_client.js rename to src/legacy/core_plugins/kibana/public/home/np_ready/sample_data_client.js index 600b1c3cb7dff..34c85d8d2c350 100644 --- a/src/legacy/core_plugins/kibana/public/home/sample_data_client.js +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/sample_data_client.js @@ -17,7 +17,7 @@ * under the License. */ -import { getServices } from './kibana_services'; +import { getServices } from '../kibana_services'; const sampleDataUrl = '/api/sample_data'; diff --git a/src/legacy/core_plugins/kibana/public/home/plugin.ts b/src/legacy/core_plugins/kibana/public/home/plugin.ts index fc1747d71d069..a998e4d07ab15 100644 --- a/src/legacy/core_plugins/kibana/public/home/plugin.ts +++ b/src/legacy/core_plugins/kibana/public/home/plugin.ts @@ -88,7 +88,7 @@ export class HomePlugin implements Plugin { indexPatternService: this.dataStart!.indexPatterns, ...angularDependencies, }); - const { renderApp } = await import('./render_app'); + const { renderApp } = await import('./np_ready/application'); return await renderApp(params.element); }, }); diff --git a/src/legacy/core_plugins/kibana/public/index.scss b/src/legacy/core_plugins/kibana/public/index.scss index 611fe613ad99c..3b49af9a4a6a6 100644 --- a/src/legacy/core_plugins/kibana/public/index.scss +++ b/src/legacy/core_plugins/kibana/public/index.scss @@ -11,13 +11,14 @@ @import './dev_tools/index'; // Discover styles -@import './discover/index'; +@import 'discover/index'; // Home styles @import './home/index'; // Visualize styles @import './visualize/index'; +@import './visualize_embeddable/index'; // Has to come after visualize because of some // bad cascading in the Editor layout @import 'src/legacy/ui/public/vis/index'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/_index.scss b/src/legacy/core_plugins/kibana/public/visualize/_index.scss index fbd218a64b5fb..0632831578bd0 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/_index.scss +++ b/src/legacy/core_plugins/kibana/public/visualize/_index.scss @@ -1,11 +1,2 @@ -// Prefix all styles with "vis" to avoid conflicts. -// Examples -// visChart -// visChart__legend -// visChart__legend--small -// visChart__legend-isLoading - -@import './editor/index'; -@import './embeddable/index'; -@import './listing/index'; -@import './wizard/index'; +// Visualize plugin styles +@import 'np_ready/index'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/_index.scss b/src/legacy/core_plugins/kibana/public/visualize/editor/_index.scss deleted file mode 100644 index 15c3c6df0ac03..0000000000000 --- a/src/legacy/core_plugins/kibana/public/visualize/editor/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './editor'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/_index.scss b/src/legacy/core_plugins/kibana/public/visualize/embeddable/_index.scss deleted file mode 100644 index 6b31803e7c8c5..0000000000000 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/_index.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import './visualize_lab_disabled'; -@import './embeddables'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/index.ts b/src/legacy/core_plugins/kibana/public/visualize/index.ts index 7c22bb3d0eaeb..bd605c5393d21 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/index.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/index.ts @@ -32,6 +32,9 @@ import { VisualizePlugin, LegacyAngularInjectedDependencies } from './plugin'; import { start as embeddables } from '../../../embeddable_api/public/np_ready/public/legacy'; import { start as visualizations } from '../../../visualizations/public/np_ready/public/legacy'; +export * from './np_ready/visualize_constants'; +export { showNewVisModal } from './np_ready/wizard'; + /** * Get dependencies relying on the global angular context. * They also have to get resolved together with the legacy imports above diff --git a/src/legacy/core_plugins/kibana/public/visualize/kibana_services.ts b/src/legacy/core_plugins/kibana/public/visualize/kibana_services.ts index 38cedc7463e7c..991ea9b214b0a 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/kibana_services.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/kibana_services.ts @@ -31,7 +31,8 @@ import { IEmbeddableStart } from '../../../../../plugins/embeddable/public'; import { SharePluginStart } from '../../../../../plugins/share/public'; import { DataPublicPluginStart, IndexPatternsContract } from '../../../../../plugins/data/public'; import { VisualizationsStart } from '../../../visualizations/public'; -import { SavedVisualizations } from './types'; +import { SavedVisualizations } from './np_ready/types'; +import { UsageCollectionSetup } from '../../../../../plugins/usage_collection/public'; export interface VisualizeKibanaServices { addBasePath: (url: string) => string; @@ -54,6 +55,7 @@ export interface VisualizeKibanaServices { uiSettings: IUiSettingsClient; visualizeCapabilities: any; visualizations: VisualizationsStart; + usageCollection?: UsageCollectionSetup; } let services: VisualizeKibanaServices | null = null; 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 b9909e522b571..febd566539bbe 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts @@ -72,4 +72,7 @@ export { defaultEditor } from 'ui/vis/editors/default/default'; export { VisType } from 'ui/vis'; export { wrapInI18nContext } from 'ui/i18n'; -export { VisSavedObject } from './embeddable/visualize_embeddable'; +export { DashboardConstants } from '../dashboard/np_ready/dashboard_constants'; +export { VisSavedObject } from '../visualize_embeddable/visualize_embeddable'; +export { VISUALIZE_EMBEDDABLE_TYPE } from '../visualize_embeddable'; +export { VisualizeEmbeddableFactory } from '../visualize_embeddable/visualize_embeddable_factory'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/listing/_index.scss b/src/legacy/core_plugins/kibana/public/visualize/listing/_index.scss deleted file mode 100644 index 0829e9af7039b..0000000000000 --- a/src/legacy/core_plugins/kibana/public/visualize/listing/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './listing'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/np_ready/_index.scss b/src/legacy/core_plugins/kibana/public/visualize/np_ready/_index.scss new file mode 100644 index 0000000000000..f97ae012055b0 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/_index.scss @@ -0,0 +1,10 @@ +// Prefix all styles with "vis" to avoid conflicts. +// Examples +// visChart +// visChart__legend +// visChart__legend--small +// visChart__legend-isLoading + +@import 'editor/index'; +@import 'listing/index'; +@import 'wizard/index'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/application.ts b/src/legacy/core_plugins/kibana/public/visualize/np_ready/application.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/visualize/application.ts rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/application.ts index 3161576eacf71..dcd68a26743ab 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/application.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/application.ts @@ -38,12 +38,12 @@ import { PrivateProvider, PromiseServiceCreator, StateManagementConfigProvider, -} from './legacy_imports'; -import { NavigationPublicPluginStart as NavigationStart } from '../../../../../plugins/navigation/public'; +} from '../legacy_imports'; +import { NavigationPublicPluginStart as NavigationStart } from '../../../../../../plugins/navigation/public'; // @ts-ignore import { initVisualizeApp } from './legacy_app'; -import { VisualizeKibanaServices } from './kibana_services'; +import { VisualizeKibanaServices } from '../kibana_services'; let angularModuleInstance: IModule | null = null; diff --git a/src/legacy/core_plugins/kibana/public/visualize/breadcrumbs.ts b/src/legacy/core_plugins/kibana/public/visualize/np_ready/breadcrumbs.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/breadcrumbs.ts rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/breadcrumbs.ts diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/_editor.scss b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/_editor.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/editor/_editor.scss rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/_editor.scss diff --git a/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/_index.scss b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/_index.scss new file mode 100644 index 0000000000000..9d3ca4b539947 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/_index.scss @@ -0,0 +1 @@ +@import 'editor'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/editor.html b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/editor/editor.html rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.html diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/visualize/editor/editor.js rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.js index f745e65cc5d1c..ed9bec9db4112 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.js @@ -21,33 +21,33 @@ import angular from 'angular'; import _ from 'lodash'; import { Subscription } from 'rxjs'; import { i18n } from '@kbn/i18n'; -import '../saved_visualizations/saved_visualizations'; +import '../../saved_visualizations/saved_visualizations'; import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { migrateAppState } from './lib'; -import { DashboardConstants } from '../../dashboard/dashboard_constants'; import { VisualizeConstants } from '../visualize_constants'; import { getEditBreadcrumbs } from '../breadcrumbs'; import { addHelpMenuToAppChrome } from '../help_menu/help_menu_util'; -import { FilterStateManager } from '../../../../data/public/filter/filter_manager'; -import { unhashUrl } from '../../../../../../plugins/kibana_utils/public'; +import { FilterStateManager } from '../../../../../data/public'; +import { unhashUrl } from '../../../../../../../plugins/kibana_utils/public'; import { initVisEditorDirective } from './visualization_editor'; import { initVisualizationDirective } from './visualization'; import { + subscribeWithScope, absoluteToParsedUrl, KibanaParsedUrl, migrateLegacyQuery, SavedObjectSaveModal, showSaveModal, stateMonitorFactory, - subscribeWithScope, -} from '../legacy_imports'; + DashboardConstants, +} from '../../legacy_imports'; -import { getServices } from '../kibana_services'; +import { getServices } from '../../kibana_services'; export function initEditorDirective(app, deps) { app.directive('visualizeApp', function() { diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/lib/index.js b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/lib/index.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/editor/lib/index.js rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/lib/index.js diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/lib/migrate_app_state.js b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/lib/migrate_app_state.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/editor/lib/migrate_app_state.js rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/lib/migrate_app_state.js diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/visualization.js b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/visualization.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/editor/visualization.js rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/visualization.js diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/visualization_editor.js b/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/visualization_editor.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/editor/visualization_editor.js rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/visualization_editor.js diff --git a/src/legacy/core_plugins/kibana/public/visualize/global_state_sync.ts b/src/legacy/core_plugins/kibana/public/visualize/np_ready/global_state_sync.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/visualize/global_state_sync.ts rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/global_state_sync.ts index 71156bc38d498..f29fb72a9fbc5 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/global_state_sync.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/global_state_sync.ts @@ -17,8 +17,8 @@ * under the License. */ -import { State } from './legacy_imports'; -import { DataPublicPluginStart as DataStart } from '../../../../../plugins/data/public'; +import { State } from '../legacy_imports'; +import { DataPublicPluginStart as DataStart } from '../../../../../../plugins/data/public'; /** * Helper function to sync the global state with the various state providers diff --git a/src/legacy/core_plugins/kibana/public/visualize/help_menu/help_menu_util.js b/src/legacy/core_plugins/kibana/public/visualize/np_ready/help_menu/help_menu_util.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/help_menu/help_menu_util.js rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/help_menu/help_menu_util.js diff --git a/src/legacy/core_plugins/kibana/public/visualize/legacy_app.js b/src/legacy/core_plugins/kibana/public/visualize/np_ready/legacy_app.js similarity index 99% rename from src/legacy/core_plugins/kibana/public/visualize/legacy_app.js rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/legacy_app.js index e948862071f69..d99771ccc912d 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/legacy_app.js +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/legacy_app.js @@ -29,7 +29,7 @@ import { VisualizeListingController } from './listing/visualize_listing'; import { ensureDefaultIndexPattern, registerTimefilterWithGlobalStateFactory, -} from './legacy_imports'; +} from '../legacy_imports'; import { syncOnMount } from './global_state_sync'; import { diff --git a/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/_index.scss b/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/_index.scss new file mode 100644 index 0000000000000..924c164e467d8 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/_index.scss @@ -0,0 +1 @@ +@import 'listing'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/listing/_listing.scss b/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/_listing.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/listing/_listing.scss rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/_listing.scss diff --git a/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.html b/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing.html similarity index 93% rename from src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.html rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing.html index 4ee8809fab228..522d20fffafd3 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.html +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing.html @@ -17,6 +17,7 @@ add-base-path="listingController.addBasePath" ui-settings="listingController.uiSettings" saved-objects="listingController.savedObjects" + usage-collection="listingController.usageCollection" >
diff --git a/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js b/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing.js similarity index 95% rename from src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing.js index ca6660f34a0a6..b7d034b78d13f 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing.js @@ -23,8 +23,8 @@ import { NewVisModal } from '../wizard/new_vis_modal'; import { VisualizeConstants } from '../visualize_constants'; import { i18n } from '@kbn/i18n'; -import { getServices } from '../kibana_services'; -import { wrapInI18nContext } from '../legacy_imports'; +import { getServices } from '../../kibana_services'; +import { wrapInI18nContext } from '../../legacy_imports'; export function initListingDirective(app) { app.directive('visualizeListingTable', reactDirective => @@ -37,6 +37,7 @@ export function initListingDirective(app) { ['addBasePath', { watchDepth: 'reference' }], ['uiSettings', { watchDepth: 'reference' }], ['savedObjects', { watchDepth: 'reference' }], + ['usageCollection', { watchDepth: 'reference' }], 'isOpen', ]) ); @@ -58,6 +59,7 @@ export function VisualizeListingController($injector, createNewVis) { uiSettings, visualizations, core: { docLinks, savedObjects }, + usageCollection, } = getServices(); const kbnUrl = $injector.get('kbnUrl'); @@ -68,6 +70,7 @@ export function VisualizeListingController($injector, createNewVis) { this.addBasePath = addBasePath; this.uiSettings = uiSettings; this.savedObjects = savedObjects; + this.usageCollection = usageCollection; this.createNewVis = () => { this.showNewVisModal = true; diff --git a/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing_table.js b/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing_table.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing_table.js rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing_table.js index 890fa64af9693..840e647edcc86 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing_table.js +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing_table.js @@ -21,11 +21,11 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { TableListView } from '../../../../../../../src/plugins/kibana_react/public'; +import { TableListView } from '../../../../../../../plugins/kibana_react/public'; import { EuiIcon, EuiBetaBadge, EuiLink, EuiButton, EuiEmptyPrompt } from '@elastic/eui'; -import { getServices } from '../kibana_services'; +import { getServices } from '../../kibana_services'; class VisualizeListingTable extends Component { constructor(props) { diff --git a/src/legacy/core_plugins/kibana/public/visualize/types.d.ts b/src/legacy/core_plugins/kibana/public/visualize/np_ready/types.d.ts similarity index 94% rename from src/legacy/core_plugins/kibana/public/visualize/types.d.ts rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/types.d.ts index b6a3981215384..f47a54baac9a1 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/types.d.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/types.d.ts @@ -17,7 +17,7 @@ * under the License. */ -import { VisSavedObject } from './legacy_imports'; +import { VisSavedObject } from '../legacy_imports'; export interface SavedVisualizations { urlFor: (id: string) => string; diff --git a/src/legacy/core_plugins/kibana/public/visualize/visualize_app.ts b/src/legacy/core_plugins/kibana/public/visualize/np_ready/visualize_app.ts similarity index 94% rename from src/legacy/core_plugins/kibana/public/visualize/visualize_app.ts rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/visualize_app.ts index c64287a0e63b8..1e7ac668697de 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/visualize_app.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/visualize_app.ts @@ -18,7 +18,7 @@ */ import { IModule } from 'angular'; -import { VisualizeKibanaServices } from './kibana_services'; +import { VisualizeKibanaServices } from '../kibana_services'; // @ts-ignore import { initEditorDirective } from './editor/editor'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/visualize_constants.ts b/src/legacy/core_plugins/kibana/public/visualize/np_ready/visualize_constants.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/visualize_constants.ts rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/visualize_constants.ts diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/__snapshots__/new_vis_modal.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/__snapshots__/new_vis_modal.test.tsx.snap diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/_dialog.scss b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/_dialog.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/_dialog.scss rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/_dialog.scss diff --git a/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/_index.scss b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/_index.scss new file mode 100644 index 0000000000000..a10b4b1b347b7 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/_index.scss @@ -0,0 +1 @@ +@import 'dialog'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/index.ts b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/index.ts rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/index.ts diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/new_vis_modal.test.tsx similarity index 97% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/new_vis_modal.test.tsx index 8e4d50d27a453..2005133e6d03e 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/new_vis_modal.test.tsx @@ -20,11 +20,10 @@ import React from 'react'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; -import { VisType } from '../legacy_imports'; -import { TypesStart } from '../../../../visualizations/public/np_ready/public/types'; +import { VisType } from '../../legacy_imports'; +import { TypesStart } from '../../../../../visualizations/public/np_ready/public/types'; -jest.mock('ui/new_platform'); -jest.mock('../legacy_imports', () => ({ +jest.mock('../../legacy_imports', () => ({ State: () => null, AppState: () => null, })); diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/new_vis_modal.tsx similarity index 86% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/new_vis_modal.tsx index e84797302589d..9e8f46407f591 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/new_vis_modal.tsx @@ -22,13 +22,17 @@ import React from 'react'; import { EuiModal, EuiOverlayMask } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { METRIC_TYPE, UiStatsMetricType } from '@kbn/analytics'; import { IUiSettingsClient, SavedObjectsStart } from 'kibana/public'; -import { VisType } from '../legacy_imports'; +import { VisType } from '../../legacy_imports'; import { VisualizeConstants } from '../visualize_constants'; -import { createUiStatsReporter, METRIC_TYPE } from '../../../../ui_metric/public'; import { SearchSelection } from './search_selection'; import { TypeSelection } from './type_selection'; -import { TypesStart, VisTypeAlias } from '../../../../visualizations/public/np_ready/public/types'; +import { + TypesStart, + VisTypeAlias, +} from '../../../../../visualizations/public/np_ready/public/types'; +import { UsageCollectionSetup } from '../../../../../../../plugins/usage_collection/public'; interface TypeSelectionProps { isOpen: boolean; @@ -38,6 +42,7 @@ interface TypeSelectionProps { addBasePath: (path: string) => string; uiSettings: IUiSettingsClient; savedObjects: SavedObjectsStart; + usageCollection?: UsageCollectionSetup; } interface TypeSelectionState { @@ -53,7 +58,9 @@ class NewVisModal extends React.Component; + private readonly trackUiMetric: + | ((type: UiStatsMetricType, eventNames: string | string[], count?: number) => void) + | undefined; constructor(props: TypeSelectionProps) { super(props); @@ -63,7 +70,10 @@ class NewVisModal extends React.Component void; diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/show_new_vis.tsx similarity index 86% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/show_new_vis.tsx index 88838e16c40e2..567b7e861ad8e 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/show_new_vis.tsx @@ -23,7 +23,8 @@ import ReactDOM from 'react-dom'; import { I18nProvider } from '@kbn/i18n/react'; import { IUiSettingsClient, SavedObjectsStart } from 'kibana/public'; import { NewVisModal } from './new_vis_modal'; -import { TypesStart } from '../../../../visualizations/public/np_ready/public/types'; +import { TypesStart } from '../../../../../visualizations/public/np_ready/public/types'; +import { UsageCollectionSetup } from '../../../../../../../plugins/usage_collection/public'; interface ShowNewVisModalParams { editorParams?: string[]; @@ -34,7 +35,8 @@ export function showNewVisModal( { editorParams = [] }: ShowNewVisModalParams = {}, addBasePath: (path: string) => string, uiSettings: IUiSettingsClient, - savedObjects: SavedObjectsStart + savedObjects: SavedObjectsStart, + usageCollection?: UsageCollectionSetup ) { const container = document.createElement('div'); const onClose = () => { @@ -53,6 +55,7 @@ export function showNewVisModal( addBasePath={addBasePath} uiSettings={uiSettings} savedObjects={savedObjects} + usageCollection={usageCollection} /> ); diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/index.ts b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/index.ts rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/index.ts diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/new_vis_help.test.tsx b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/new_vis_help.test.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/new_vis_help.test.tsx rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/new_vis_help.test.tsx diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/new_vis_help.tsx b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/new_vis_help.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/new_vis_help.tsx rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/new_vis_help.tsx diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/type_selection.tsx similarity index 97% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/type_selection.tsx index 38cd7fbe315ad..28cafde45a714 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/type_selection.tsx @@ -34,13 +34,13 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { VisType } from '../../legacy_imports'; -import { memoizeLast } from '../../../../../visualizations/public/np_ready/public/legacy/memoize'; -import { VisTypeAlias } from '../../../../../visualizations/public'; +import { VisType } from '../../../legacy_imports'; +import { memoizeLast } from '../../../../../../visualizations/public/np_ready/public/legacy/memoize'; +import { VisTypeAlias } from '../../../../../../visualizations/public'; import { NewVisHelp } from './new_vis_help'; import { VisHelpText } from './vis_help_text'; import { VisTypeIcon } from './vis_type_icon'; -import { TypesStart } from '../../../../../visualizations/public/np_ready/public/types'; +import { TypesStart } from '../../../../../../visualizations/public/np_ready/public/types'; export interface VisTypeListEntry extends VisType { highlighted: boolean; diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/vis_help_text.tsx b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/vis_help_text.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/vis_help_text.tsx rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/vis_help_text.tsx diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/vis_type_icon.tsx b/src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/vis_type_icon.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/vis_type_icon.tsx rename to src/legacy/core_plugins/kibana/public/visualize/np_ready/wizard/type_selection/vis_type_icon.tsx diff --git a/src/legacy/core_plugins/kibana/public/visualize/plugin.ts b/src/legacy/core_plugins/kibana/public/visualize/plugin.ts index 9dff936761a4b..d1afa2d065194 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/plugin.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/plugin.ts @@ -34,16 +34,20 @@ import { NavigationPublicPluginStart as NavigationStart } from '../../../../../p import { SharePluginStart } from '../../../../../plugins/share/public'; import { KibanaLegacySetup } from '../../../../../plugins/kibana_legacy/public'; import { VisualizationsStart } from '../../../visualizations/public'; -import { VisualizeEmbeddableFactory } from './embeddable/visualize_embeddable_factory'; -import { VISUALIZE_EMBEDDABLE_TYPE } from './embeddable/constants'; -import { VisualizeConstants } from './visualize_constants'; +import { VisualizeConstants } from './np_ready/visualize_constants'; import { setServices, VisualizeKibanaServices } from './kibana_services'; import { FeatureCatalogueCategory, HomePublicPluginSetup, } from '../../../../../plugins/home/public'; -import { defaultEditor, VisEditorTypesRegistryProvider } from './legacy_imports'; -import { SavedVisualizations } from './types'; +import { + defaultEditor, + VisEditorTypesRegistryProvider, + VisualizeEmbeddableFactory, + VISUALIZE_EMBEDDABLE_TYPE, +} from './legacy_imports'; +import { SavedVisualizations } from './np_ready/types'; +import { UsageCollectionSetup } from '../../../../../plugins/usage_collection/public'; export interface LegacyAngularInjectedDependencies { legacyChrome: any; @@ -66,6 +70,7 @@ export interface VisualizePluginSetupDependencies { }; home: HomePublicPluginSetup; kibana_legacy: KibanaLegacySetup; + usageCollection?: UsageCollectionSetup; } export class VisualizePlugin implements Plugin { @@ -80,7 +85,12 @@ export class VisualizePlugin implements Plugin { public async setup( core: CoreSetup, - { home, kibana_legacy, __LEGACY: { getAngularDependencies } }: VisualizePluginSetupDependencies + { + home, + kibana_legacy, + __LEGACY: { getAngularDependencies }, + usageCollection, + }: VisualizePluginSetupDependencies ) { kibana_legacy.registerLegacyApp({ id: 'visualize', @@ -118,10 +128,11 @@ export class VisualizePlugin implements Plugin { uiSettings: contextCore.uiSettings, visualizeCapabilities: contextCore.application.capabilities.visualize, visualizations, + usageCollection, }; setServices(deps); - const { renderApp } = await import('./application'); + const { renderApp } = await import('./np_ready/application'); return renderApp(params.element, params.appBasePath, deps); }, }); diff --git a/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/_saved_vis.ts b/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/_saved_vis.ts index 3490e0ab127ed..9f7ba342d803f 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/_saved_vis.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/_saved_vis.ts @@ -29,12 +29,12 @@ import { Vis } from 'ui/vis'; import { SavedObject, SavedObjectKibanaServices } from 'ui/saved_objects/types'; import { createSavedObjectClass } from 'ui/saved_objects/saved_object'; import { updateOldState } from '../../../../visualizations/public'; -import { VisualizeConstants } from '../visualize_constants'; import { extractReferences, injectReferences } from './saved_visualization_references'; import { IIndexPattern } from '../../../../../../plugins/data/public'; import { VisSavedObject } from '../legacy_imports'; import { createSavedSearchesService } from '../../discover'; +import { VisualizeConstants } from '..'; async function _afterEsResp(savedVis: VisSavedObject, services: any) { await _getLinkedSavedSearch(savedVis, services); diff --git a/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualization_references.test.ts b/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualization_references.test.ts index 6549b317d1634..b71a10ab000d8 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualization_references.test.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualization_references.test.ts @@ -18,7 +18,7 @@ */ import { extractReferences, injectReferences } from './saved_visualization_references'; -import { VisSavedObject } from '../embeddable/visualize_embeddable'; +import { VisSavedObject } from '../../visualize_embeddable/visualize_embeddable'; describe('extractReferences', () => { test('extracts nothing if savedSearchId is empty', () => { diff --git a/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualization_references.ts b/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualization_references.ts index dd8c2e9d2b74f..0c76aaff4345d 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualization_references.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualization_references.ts @@ -17,7 +17,7 @@ * under the License. */ import { SavedObjectAttributes, SavedObjectReference } from 'kibana/server'; -import { VisSavedObject } from '../embeddable/visualize_embeddable'; +import { VisSavedObject } from '../../visualize_embeddable/visualize_embeddable'; export function extractReferences({ attributes, diff --git a/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.ts b/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.ts index 7425250bffe1a..aa8d20fed4828 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/saved_visualizations/saved_visualizations.ts @@ -22,10 +22,10 @@ import { uiModules } from 'ui/modules'; import { SavedObjectLoader } from 'ui/saved_objects'; import { start as visualizations } from '../../../../visualizations/public/np_ready/public/legacy'; -import { createVisualizeEditUrl } from '../visualize_constants'; // @ts-ignore import { findListItems } from './find_list_items'; import { createSavedVisClass } from './_saved_vis'; +import { createVisualizeEditUrl } from '..'; const app = uiModules.get('app/visualize'); app.service('savedVisualizations', function() { diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/_index.scss b/src/legacy/core_plugins/kibana/public/visualize/wizard/_index.scss deleted file mode 100644 index 328af16f3eebd..0000000000000 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './dialog'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/_embeddables.scss b/src/legacy/core_plugins/kibana/public/visualize_embeddable/_embeddables.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/embeddable/_embeddables.scss rename to src/legacy/core_plugins/kibana/public/visualize_embeddable/_embeddables.scss diff --git a/src/legacy/core_plugins/kibana/public/visualize_embeddable/_index.scss b/src/legacy/core_plugins/kibana/public/visualize_embeddable/_index.scss new file mode 100644 index 0000000000000..c1e3809657bfa --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/visualize_embeddable/_index.scss @@ -0,0 +1,2 @@ +@import 'visualize_lab_disabled'; +@import 'embeddables'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/_visualize_lab_disabled.scss b/src/legacy/core_plugins/kibana/public/visualize_embeddable/_visualize_lab_disabled.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/embeddable/_visualize_lab_disabled.scss rename to src/legacy/core_plugins/kibana/public/visualize_embeddable/_visualize_lab_disabled.scss diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/constants.ts b/src/legacy/core_plugins/kibana/public/visualize_embeddable/constants.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/embeddable/constants.ts rename to src/legacy/core_plugins/kibana/public/visualize_embeddable/constants.ts diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx b/src/legacy/core_plugins/kibana/public/visualize_embeddable/disabled_lab_embeddable.tsx similarity index 94% rename from src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx rename to src/legacy/core_plugins/kibana/public/visualize_embeddable/disabled_lab_embeddable.tsx index d8792a761b186..f9dfd5d2b98f4 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_embeddable.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize_embeddable/disabled_lab_embeddable.tsx @@ -19,7 +19,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { Embeddable, EmbeddableOutput } from '../../../../../../plugins/embeddable/public'; +import { Embeddable, EmbeddableOutput } from '../../../../../plugins/embeddable/public'; import { DisabledLabVisualization } from './disabled_lab_visualization'; import { VisualizeInput } from './visualize_embeddable'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_visualization.tsx b/src/legacy/core_plugins/kibana/public/visualize_embeddable/disabled_lab_visualization.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/embeddable/disabled_lab_visualization.tsx rename to src/legacy/core_plugins/kibana/public/visualize_embeddable/disabled_lab_visualization.tsx diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/get_index_pattern.ts b/src/legacy/core_plugins/kibana/public/visualize_embeddable/get_index_pattern.ts similarity index 95% rename from src/legacy/core_plugins/kibana/public/visualize/embeddable/get_index_pattern.ts rename to src/legacy/core_plugins/kibana/public/visualize_embeddable/get_index_pattern.ts index 7fe3678bb1f77..36efc4b86d0d3 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/get_index_pattern.ts +++ b/src/legacy/core_plugins/kibana/public/visualize_embeddable/get_index_pattern.ts @@ -20,7 +20,7 @@ import { npStart } from 'ui/new_platform'; import { VisSavedObject } from './visualize_embeddable'; -import { indexPatterns, IIndexPattern } from '../../../../../../plugins/data/public'; +import { indexPatterns, IIndexPattern } from '../../../../../plugins/data/public'; export async function getIndexPattern( savedVis: VisSavedObject diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/index.ts b/src/legacy/core_plugins/kibana/public/visualize_embeddable/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/visualize/embeddable/index.ts rename to src/legacy/core_plugins/kibana/public/visualize_embeddable/index.ts diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts b/src/legacy/core_plugins/kibana/public/visualize_embeddable/visualize_embeddable.ts similarity index 98% rename from src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts rename to src/legacy/core_plugins/kibana/public/visualize_embeddable/visualize_embeddable.ts index 45cc1dc5fb9dd..6aade246d5f65 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.ts +++ b/src/legacy/core_plugins/kibana/public/visualize_embeddable/visualize_embeddable.ts @@ -38,16 +38,16 @@ import { onlyDisabledFiltersChanged, esFilters, mapAndFlattenFilters, -} from '../../../../../../plugins/data/public'; +} from '../../../../../plugins/data/public'; import { EmbeddableInput, EmbeddableOutput, Embeddable, Container, APPLY_FILTER_TRIGGER, -} from '../../../../../../plugins/embeddable/public'; -import { dispatchRenderComplete } from '../../../../../../plugins/kibana_utils/public'; -import { SavedSearch } from '../../discover/types'; +} from '../../../../../plugins/embeddable/public'; +import { dispatchRenderComplete } from '../../../../../plugins/kibana_utils/public'; +import { SavedSearch } from '../discover/np_ready/types'; const getKeys = (o: T): Array => Object.keys(o) as Array; diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.tsx b/src/legacy/core_plugins/kibana/public/visualize_embeddable/visualize_embeddable_factory.tsx similarity index 93% rename from src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.tsx rename to src/legacy/core_plugins/kibana/public/visualize_embeddable/visualize_embeddable_factory.tsx index a377dafe9e512..dd6723fb578af 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize_embeddable/visualize_embeddable_factory.tsx @@ -35,7 +35,7 @@ import 'uiExports/visualize'; import { i18n } from '@kbn/i18n'; import chrome from 'ui/chrome'; -import { npStart } from 'ui/new_platform'; +import { npSetup, npStart } from 'ui/new_platform'; import { Legacy } from 'kibana'; @@ -45,10 +45,10 @@ import { ErrorEmbeddable, Container, EmbeddableOutput, -} from '../../../../../../plugins/embeddable/public'; -import { start as visualizations } from '../../../../visualizations/public/np_ready/public/legacy'; -import { showNewVisModal } from '../wizard'; -import { SavedVisualizations } from '../types'; +} from '../../../../../plugins/embeddable/public'; +import { start as visualizations } from '../../../visualizations/public/np_ready/public/legacy'; +import { showNewVisModal } from '../visualize'; +import { SavedVisualizations } from '../visualize/np_ready/types'; import { DisabledLabEmbeddable } from './disabled_lab_embeddable'; import { getIndexPattern } from './get_index_pattern'; import { @@ -58,7 +58,7 @@ import { VisSavedObject, } from './visualize_embeddable'; import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; -import { TypesStart } from '../../../../visualizations/public/np_ready/public/types'; +import { TypesStart } from '../../../visualizations/public/np_ready/public/types'; interface VisualizationAttributes extends SavedObjectAttributes { visState: string; @@ -200,7 +200,8 @@ export class VisualizeEmbeddableFactory extends EmbeddableFactory< }, npStart.core.http.basePath.prepend, npStart.core.uiSettings, - npStart.core.savedObjects + npStart.core.savedObjects, + npSetup.plugins.usageCollection ); } return undefined; diff --git a/src/legacy/core_plugins/timelion/index.ts b/src/legacy/core_plugins/timelion/index.ts index 77e62ed02718c..ec121647f4e47 100644 --- a/src/legacy/core_plugins/timelion/index.ts +++ b/src/legacy/core_plugins/timelion/index.ts @@ -31,7 +31,7 @@ const experimentalLabel = i18n.translate('timelion.uiSettings.experimentalLabel' const timelionPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) => new Plugin({ - require: ['kibana', 'elasticsearch'], + require: ['kibana', 'elasticsearch', 'data'], config(Joi: any) { return Joi.object({ enabled: Joi.boolean().default(true), diff --git a/src/legacy/core_plugins/timelion/public/app.js b/src/legacy/core_plugins/timelion/public/app.js index bff847becb7a8..365e74e93c4ad 100644 --- a/src/legacy/core_plugins/timelion/public/app.js +++ b/src/legacy/core_plugins/timelion/public/app.js @@ -40,6 +40,7 @@ import 'ui/directives/saved_object_finder'; import 'ui/directives/listen'; import 'ui/kbn_top_nav'; import 'ui/saved_objects/ui/saved_object_save_as_checkbox'; +import '../../data/public/legacy'; import './services/saved_sheets'; import './services/_saved_sheet'; import './services/saved_sheet_register'; diff --git a/src/legacy/ui/public/registry/doc_views_helpers.tsx b/src/legacy/ui/public/registry/doc_views_helpers.tsx index d9e42e71dfff1..61545609f205d 100644 --- a/src/legacy/ui/public/registry/doc_views_helpers.tsx +++ b/src/legacy/ui/public/registry/doc_views_helpers.tsx @@ -26,7 +26,7 @@ import { AngularController, AngularDirective, } from './doc_views_types'; -import { DocViewerError } from '../../../core_plugins/kibana/public/discover/components/doc_viewer/doc_viewer_render_error'; +import { DocViewerError } from '../../../core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_error'; /** * Compiles and injects the give angular template into the given dom node diff --git a/src/legacy/ui/public/styles/_legacy/components/_table.scss b/src/legacy/ui/public/styles/_legacy/components/_table.scss index e7c1bda829f0e..c9472cbd2faa7 100644 --- a/src/legacy/ui/public/styles/_legacy/components/_table.scss +++ b/src/legacy/ui/public/styles/_legacy/components/_table.scss @@ -1,4 +1,4 @@ -@import '../../../../../core_plugins/kibana/public/discover/mixins'; +@import '../../../../../core_plugins/kibana/public/discover/np_ready/mixins'; .table { // Nesting diff --git a/src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.tsx b/src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.tsx index bab710cdca595..33d4dcfd6606a 100644 --- a/src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.tsx +++ b/src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.tsx @@ -39,7 +39,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import React from 'react'; import { EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../legacy/core_plugins/kibana/public/visualize/embeddable/constants'; +import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../legacy/core_plugins/kibana/public/visualize_embeddable/constants'; export interface OnSaveProps { newTitle: string; diff --git a/test/functional/apps/dashboard/create_and_add_embeddables.js b/test/functional/apps/dashboard/create_and_add_embeddables.js index 2e0c4d449d447..90f02c36b3b7f 100644 --- a/test/functional/apps/dashboard/create_and_add_embeddables.js +++ b/test/functional/apps/dashboard/create_and_add_embeddables.js @@ -19,7 +19,7 @@ import expect from '@kbn/expect'; -import { VisualizeConstants } from '../../../../src/legacy/core_plugins/kibana/public/visualize/visualize_constants'; +import { VisualizeConstants } from '../../../../src/legacy/core_plugins/kibana/public/visualize/np_ready/visualize_constants'; export default function({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/dashboard/panel_controls.js b/test/functional/apps/dashboard/panel_controls.js index b69e031f84667..683f3683e65e5 100644 --- a/test/functional/apps/dashboard/panel_controls.js +++ b/test/functional/apps/dashboard/panel_controls.js @@ -24,7 +24,7 @@ import { AREA_CHART_VIS_NAME, LINE_CHART_VIS_NAME, } from '../../page_objects/dashboard_page'; -import { VisualizeConstants } from '../../../../src/legacy/core_plugins/kibana/public/visualize/visualize_constants'; +import { VisualizeConstants } from '../../../../src/legacy/core_plugins/kibana/public/visualize/np_ready/visualize_constants'; export default function({ getService, getPageObjects }) { const browser = getService('browser'); diff --git a/test/functional/page_objects/dashboard_page.js b/test/functional/page_objects/dashboard_page.js index ec258aa823405..b0f1a3304a9b8 100644 --- a/test/functional/page_objects/dashboard_page.js +++ b/test/functional/page_objects/dashboard_page.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import { DashboardConstants } from '../../../src/legacy/core_plugins/kibana/public/dashboard/dashboard_constants'; +import { DashboardConstants } from '../../../src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants'; export const PIE_CHART_VIS_NAME = 'Visualization PieChart'; export const AREA_CHART_VIS_NAME = 'Visualization漢字 AreaChart'; diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index 33b7515b58d2d..c1ea8be9be98b 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -17,7 +17,7 @@ * under the License. */ -import { VisualizeConstants } from '../../../src/legacy/core_plugins/kibana/public/visualize/visualize_constants'; +import { VisualizeConstants } from '../../../src/legacy/core_plugins/kibana/public/visualize/np_ready/visualize_constants'; import Bluebird from 'bluebird'; import expect from '@kbn/expect'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts index 546e8967a7439..3669bd3e08201 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts @@ -6,8 +6,8 @@ // @ts-ignore import { MAP_SAVED_OBJECT_TYPE } from '../../../maps/common/constants'; -import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/visualize/embeddable/constants'; -import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/discover/embeddable/constants'; +import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/visualize_embeddable/constants'; +import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/constants'; export const EmbeddableTypes = { map: MAP_SAVED_OBJECT_TYPE, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_search.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_search.ts index fc61208ea47a0..c1f89eeaa232d 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_search.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_search.ts @@ -5,7 +5,7 @@ */ import { ExpressionFunction } from 'src/plugins/expressions/common/types'; -import { SearchInput } from 'src/legacy/core_plugins/kibana/public/discover/embeddable'; +import { SearchInput } from 'src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable'; import { EmbeddableTypes, EmbeddableExpressionType, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.ts index 43a5d5fdf4988..95366118942ba 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.ts @@ -5,7 +5,7 @@ */ import { ExpressionFunction } from 'src/plugins/expressions/common/types'; -import { VisualizeInput } from 'src/legacy/core_plugins/kibana/public/visualize/embeddable'; +import { VisualizeInput } from 'src/legacy/core_plugins/kibana/public/visualize_embeddable'; import { EmbeddableTypes, EmbeddableExpressionType, diff --git a/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js b/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js index f0a0bf90d9e49..470fa00734d27 100644 --- a/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js +++ b/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js @@ -30,7 +30,6 @@ import 'uiExports/shareContextMenuExtensions'; import _ from 'lodash'; import 'ui/autoload/all'; import 'ui/kbn_top_nav'; -import 'plugins/kibana/dashboard'; import 'ui/vislib'; import 'ui/agg_response'; import 'ui/agg_types'; @@ -39,10 +38,7 @@ import { npStart } from 'ui/new_platform'; import { localApplicationService } from 'plugins/kibana/local_application_service'; import { showAppRedirectNotification } from 'ui/notify'; -import { - DashboardConstants, - createDashboardEditUrl, -} from 'plugins/kibana/dashboard/dashboard_constants'; +import { DashboardConstants, createDashboardEditUrl } from 'plugins/kibana/dashboard'; uiModules .get('kibana') diff --git a/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx b/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx index ebb57d34c01a1..95ca1792a7eb1 100644 --- a/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx +++ b/x-pack/legacy/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx @@ -19,8 +19,8 @@ import { IEmbeddable, CONTEXT_MENU_TRIGGER, } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; -import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/discover/embeddable/constants'; -import { ISearchEmbeddable } from '../../../../../../src/legacy/core_plugins/kibana/public/discover/embeddable/types'; +import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/constants'; +import { ISearchEmbeddable } from '../../../../../../src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/types'; import { API_BASE_URL_V1 } from '../../common/constants'; diff --git a/x-pack/legacy/plugins/transform/public/app/lib/kibana/kibana_context.tsx b/x-pack/legacy/plugins/transform/public/app/lib/kibana/kibana_context.tsx index 3a3bd33ff6d70..5b7702a0193ec 100644 --- a/x-pack/legacy/plugins/transform/public/app/lib/kibana/kibana_context.tsx +++ b/x-pack/legacy/plugins/transform/public/app/lib/kibana/kibana_context.tsx @@ -6,7 +6,7 @@ import React, { createContext, useContext, FC } from 'react'; -import { SavedSearch } from '../../../../../../../../src/legacy/core_plugins/kibana/public/discover/types'; +import { SavedSearch } from '../../../../../../../../src/legacy/core_plugins/kibana/public/discover/np_ready/types'; import { IndexPattern, IndexPatternsContract, diff --git a/x-pack/legacy/plugins/transform/public/plugin.ts b/x-pack/legacy/plugins/transform/public/plugin.ts index 08a3a06fc24fc..5d1c39add4ff6 100644 --- a/x-pack/legacy/plugins/transform/public/plugin.ts +++ b/x-pack/legacy/plugins/transform/public/plugin.ts @@ -7,7 +7,7 @@ import { unmountComponentAtNode } from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { SavedSearchLoader } from '../../../../../src/legacy/core_plugins/kibana/public/discover/types'; +import { SavedSearchLoader } from '../../../../../src/legacy/core_plugins/kibana/public/discover/np_ready/types'; import { PLUGIN } from '../common/constants'; import { CLIENT_BASE_PATH } from './app/constants'; diff --git a/x-pack/legacy/plugins/transform/public/shim.ts b/x-pack/legacy/plugins/transform/public/shim.ts index 5d7c309ade211..f8edc752c9a21 100644 --- a/x-pack/legacy/plugins/transform/public/shim.ts +++ b/x-pack/legacy/plugins/transform/public/shim.ts @@ -12,7 +12,7 @@ import { docTitle } from 'ui/doc_title/doc_title'; // @ts-ignore: allow traversal to fail on x-pack build import { createUiStatsReporter } from '../../../../../src/legacy/core_plugins/ui_metric/public'; -import { SavedSearchLoader } from '../../../../../src/legacy/core_plugins/kibana/public/discover/types'; +import { SavedSearchLoader } from '../../../../../src/legacy/core_plugins/kibana/public/discover/np_ready/types'; export type npCore = typeof npStart.core; diff --git a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts index efc1f9d5e5e40..c7a9764c6fb58 100644 --- a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts +++ b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { createDashboardEditUrl, DashboardConstants, -} from '../../../../../../src/legacy/core_plugins/kibana/public/dashboard/dashboard_constants'; +} from '../../../../../../src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getPageObjects, getService }: FtrProviderContext) { diff --git a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_spaces.ts b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_spaces.ts index d98ad2db09430..127141b156cd8 100644 --- a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_spaces.ts +++ b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_spaces.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { createDashboardEditUrl, DashboardConstants, -} from '../../../../../../src/legacy/core_plugins/kibana/public/dashboard/dashboard_constants'; +} from '../../../../../../src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getPageObjects, getService }: FtrProviderContext) { diff --git a/x-pack/test/functional/apps/visualize/feature_controls/visualize_spaces.ts b/x-pack/test/functional/apps/visualize/feature_controls/visualize_spaces.ts index 49ad137b8da6b..d0fdc7c95ea38 100644 --- a/x-pack/test/functional/apps/visualize/feature_controls/visualize_spaces.ts +++ b/x-pack/test/functional/apps/visualize/feature_controls/visualize_spaces.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from '@kbn/expect'; -import { VisualizeConstants } from '../../../../../../src/legacy/core_plugins/kibana/public/visualize/visualize_constants'; +import { VisualizeConstants } from '../../../../../../src/legacy/core_plugins/kibana/public/visualize/np_ready/visualize_constants'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getPageObjects, getService }: FtrProviderContext) {