diff --git a/docs/api/features.asciidoc b/docs/api/features.asciidoc index da8b0edfe2261..57a87ff6342f9 100644 --- a/docs/api/features.asciidoc +++ b/docs/api/features.asciidoc @@ -29,7 +29,7 @@ The API returns the following: "id": "discover", "name": "Discover", "icon": "discoverApp", - "navLinkId": "kibana:discover", + "navLinkId": "discover", "app": [ "kibana" ], @@ -74,7 +74,7 @@ The API returns the following: "id": "visualize", "name": "Visualize", "icon": "visualizeApp", - "navLinkId": "kibana:visualize", + "navLinkId": "visualize", "app": [ "kibana" ], @@ -121,7 +121,7 @@ The API returns the following: "id": "dashboard", "name": "Dashboard", "icon": "dashboardApp", - "navLinkId": "kibana:dashboard", + "navLinkId": "dashboards", "app": [ "kibana" ], @@ -173,7 +173,7 @@ The API returns the following: "id": "dev_tools", "name": "Dev Tools", "icon": "devToolsApp", - "navLinkId": "kibana:dev_tools", + "navLinkId": "dev_tools", "app": [ "kibana" ], diff --git a/docs/developer/plugin/development-plugin-feature-registration.asciidoc b/docs/developer/plugin/development-plugin-feature-registration.asciidoc index 4702204196bf2..d594a6d4255b2 100644 --- a/docs/developer/plugin/development-plugin-feature-registration.asciidoc +++ b/docs/developer/plugin/development-plugin-feature-registration.asciidoc @@ -153,7 +153,7 @@ init(server) { defaultMessage: 'Dev Tools', }), icon: 'devToolsApp', - navLinkId: 'kibana:dev_tools', + navLinkId: 'dev_tools', app: ['kibana'], catalogue: ['console', 'searchprofiler', 'grokdebugger'], privileges: { @@ -216,7 +216,7 @@ init(server) { }), order: 100, icon: 'discoverApp', - navLinkId: 'kibana:discover', + navLinkId: 'discover', app: ['kibana'], catalogue: ['discover'], privileges: { diff --git a/docs/user/dashboard.asciidoc b/docs/user/dashboard.asciidoc index de714ae40086b..301efb2dfe2c0 100644 --- a/docs/user/dashboard.asciidoc +++ b/docs/user/dashboard.asciidoc @@ -174,7 +174,7 @@ to view an embedded dashboard. * Generate a PNG report TIP: To create a link to a dashboard by title, use: + -`${domain}/${basepath?}/app/kibana#/dashboards?title=${yourdashboardtitle}` +`${domain}/${basepath?}/app/dashboards#/list?title=${yourdashboardtitle}` TIP: When sharing a link to a dashboard snapshot, use the *Short URL*. Snapshot URLs are long and can be problematic for Internet Explorer and other diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index 3fc22caaefb04..bf1a764e85882 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -192,7 +192,7 @@ export class ChromeService { forceAppSwitcherNavigation$={navLinks.getForceAppSwitcherNavigation$()} helpExtension$={helpExtension$.pipe(takeUntil(this.stop$))} helpSupportUrl$={helpSupportUrl$.pipe(takeUntil(this.stop$))} - homeHref={http.basePath.prepend('/app/kibana#/home')} + homeHref={http.basePath.prepend('/app/home')} isVisible$={this.isVisible$} kibanaVersion={injectedMetadata.getKibanaVersion()} legacyMode={injectedMetadata.getLegacyMode()} diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap index 14d5b2e8fdcbb..ed97db020035e 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap @@ -116,6 +116,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` }, ] } + navigateToApp={[Function]} onIsLockedUpdate={[Function]} onIsOpenUpdate={[Function]} recentNavLinks={ @@ -2993,6 +2994,7 @@ exports[`CollapsibleNav renders the default nav 1`] = ` isLocked={false} isOpen={false} navLinks={Array []} + navigateToApp={[Function]} onIsLockedUpdate={[Function]} onIsOpenUpdate={[Function]} recentNavLinks={Array []} @@ -3023,6 +3025,7 @@ exports[`CollapsibleNav renders the default nav 2`] = ` isLocked={false} isOpen={true} navLinks={Array []} + navigateToApp={[Function]} onIsLockedUpdate={[Function]} onIsOpenUpdate={[Function]} recentNavLinks={Array []} @@ -3589,6 +3592,7 @@ exports[`CollapsibleNav renders the default nav 3`] = ` isLocked={true} isOpen={true} navLinks={Array []} + navigateToApp={[Function]} onIsLockedUpdate={[Function]} onIsOpenUpdate={[Function]} recentNavLinks={Array []} diff --git a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx index 4a9d3071b93be..0917f47ebe9b1 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx @@ -63,6 +63,7 @@ function mockProps() { storage: new StubBrowserStorage(), onIsOpenUpdate: () => {}, onIsLockedUpdate: () => {}, + navigateToApp: () => {}, }; } diff --git a/src/core/public/chrome/ui/header/collapsible_nav.tsx b/src/core/public/chrome/ui/header/collapsible_nav.tsx index 274195f1917a5..9adcc19b0f0e7 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.tsx @@ -78,6 +78,7 @@ interface Props { storage?: Storage; onIsLockedUpdate: OnIsLockedUpdate; onIsOpenUpdate: (isOpen?: boolean) => void; + navigateToApp: (appId: string) => void; } export function CollapsibleNav({ @@ -89,6 +90,7 @@ export function CollapsibleNav({ onIsOpenUpdate, homeHref, id, + navigateToApp, storage = window.localStorage, }: Props) { const lockRef = useRef(null); @@ -124,7 +126,19 @@ export function CollapsibleNav({ label: 'Home', iconType: 'home', href: homeHref, - onClick: () => onIsOpenUpdate(false), + onClick: (event: React.MouseEvent) => { + onIsOpenUpdate(false); + if ( + event.isDefaultPrevented() || + event.altKey || + event.metaKey || + event.ctrlKey + ) { + return; + } + event.preventDefault(); + navigateToApp('home'); + }, }, ]} maxWidth="none" diff --git a/src/core/public/chrome/ui/header/header.tsx b/src/core/public/chrome/ui/header/header.tsx index fb94ef46cdc2c..09bc3972e0e40 100644 --- a/src/core/public/chrome/ui/header/header.tsx +++ b/src/core/public/chrome/ui/header/header.tsx @@ -247,6 +247,7 @@ export class Header extends Component { href={this.props.homeHref} forceNavigation={this.state.forceNavigation} navLinks={navLinks} + navigateToApp={this.props.application.navigateToApp} /> @@ -287,6 +288,7 @@ export class Header extends Component { this.toggleCollapsibleNavRef.current.focus(); } }} + navigateToApp={this.props.application.navigateToApp} /> ) : ( // TODO #64541 diff --git a/src/core/public/chrome/ui/header/header_logo.tsx b/src/core/public/chrome/ui/header/header_logo.tsx index 960ec637178e1..4296064945455 100644 --- a/src/core/public/chrome/ui/header/header_logo.tsx +++ b/src/core/public/chrome/ui/header/header_logo.tsx @@ -41,7 +41,8 @@ function findClosestAnchor(element: HTMLElement): HTMLAnchorElement | void { function onClick( event: React.MouseEvent, forceNavigation: boolean, - navLinks: NavLink[] + navLinks: NavLink[], + navigateToApp: (appId: string) => void ) { const anchor = findClosestAnchor((event as any).nativeEvent.target); if (!anchor) { @@ -54,32 +55,31 @@ function onClick( return; } - if ( - !forceNavigation || - event.isDefaultPrevented() || - event.altKey || - event.metaKey || - event.ctrlKey - ) { + if (event.isDefaultPrevented() || event.altKey || event.metaKey || event.ctrlKey) { return; } - const toParsed = Url.parse(anchor.href); - const fromParsed = Url.parse(document.location.href); - const sameProto = toParsed.protocol === fromParsed.protocol; - const sameHost = toParsed.host === fromParsed.host; - const samePath = toParsed.path === fromParsed.path; + if (forceNavigation) { + const toParsed = Url.parse(anchor.href); + const fromParsed = Url.parse(document.location.href); + const sameProto = toParsed.protocol === fromParsed.protocol; + const sameHost = toParsed.host === fromParsed.host; + const samePath = toParsed.path === fromParsed.path; - if (sameProto && sameHost && samePath) { - if (toParsed.hash) { - document.location.reload(); - } + if (sameProto && sameHost && samePath) { + if (toParsed.hash) { + document.location.reload(); + } - // event.preventDefault() keeps the browser from seeing the new url as an update - // and even setting window.location does not mimic that behavior, so instead - // we use stopPropagation() to prevent angular from seeing the click and - // starting a digest cycle/attempting to handle it in the router. - event.stopPropagation(); + // event.preventDefault() keeps the browser from seeing the new url as an update + // and even setting window.location does not mimic that behavior, so instead + // we use stopPropagation() to prevent angular from seeing the click and + // starting a digest cycle/attempting to handle it in the router. + event.stopPropagation(); + } + } else { + navigateToApp('home'); + event.preventDefault(); } } @@ -87,14 +87,15 @@ interface Props { href: string; navLinks: NavLink[]; forceNavigation: boolean; + navigateToApp: (appId: string) => void; } -export function HeaderLogo({ href, forceNavigation, navLinks }: Props) { +export function HeaderLogo({ href, forceNavigation, navLinks, navigateToApp }: Props) { return ( onClick(e, forceNavigation, navLinks)} + onClick={e => onClick(e, forceNavigation, navLinks, navigateToApp)} href={href} aria-label={i18n.translate('core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel', { defaultMessage: 'Go to home page', diff --git a/src/core/server/core_app/integration_tests/default_route_provider_config.test.ts b/src/core/server/core_app/integration_tests/default_route_provider_config.test.ts index 221e6fa42471c..2c7efe075152b 100644 --- a/src/core/server/core_app/integration_tests/default_route_provider_config.test.ts +++ b/src/core/server/core_app/integration_tests/default_route_provider_config.test.ts @@ -49,7 +49,7 @@ describe('default route provider', () => { expect(status).toEqual(302); expect(header).toMatchObject({ - location: '/hello/app/kibana', + location: '/hello/app/home', }); }); @@ -71,7 +71,7 @@ describe('default route provider', () => { const { status, header } = await kbnTestServer.request.get(root, '/'); expect(status).toEqual(302); expect(header).toMatchObject({ - location: '/hello/app/kibana', + location: '/hello/app/home', }); }); diff --git a/src/legacy/core_plugins/kibana/index.js b/src/legacy/core_plugins/kibana/index.js index 3a796b3ba520c..5807c439bd277 100644 --- a/src/legacy/core_plugins/kibana/index.js +++ b/src/legacy/core_plugins/kibana/index.js @@ -52,7 +52,6 @@ export default function(kibana) { }, uiExports: { - hacks: ['plugins/kibana/dev_tools'], app: { id: 'kibana', title: 'Kibana', @@ -61,49 +60,6 @@ export default function(kibana) { }, styleSheetPaths: resolve(__dirname, 'public/index.scss'), links: [ - { - id: 'kibana:discover', - title: i18n.translate('kbn.discoverTitle', { - defaultMessage: 'Discover', - }), - order: 2000, - url: `${kbnBaseUrl}#/discover`, - euiIconType: 'discoverApp', - disableSubUrlTracking: true, - category: DEFAULT_APP_CATEGORIES.kibana, - }, - { - id: 'kibana:visualize', - title: i18n.translate('kbn.visualizeTitle', { - defaultMessage: 'Visualize', - }), - order: 7000, - url: `${kbnBaseUrl}#/visualize`, - euiIconType: 'visualizeApp', - disableSubUrlTracking: true, - category: DEFAULT_APP_CATEGORIES.kibana, - }, - { - id: 'kibana:dashboard', - title: i18n.translate('kbn.dashboardTitle', { - defaultMessage: 'Dashboard', - }), - order: 1000, - url: `${kbnBaseUrl}#/dashboards`, - euiIconType: 'dashboardApp', - disableSubUrlTracking: true, - category: DEFAULT_APP_CATEGORIES.kibana, - }, - { - id: 'kibana:dev_tools', - title: i18n.translate('kbn.devToolsTitle', { - defaultMessage: 'Dev Tools', - }), - order: 9001, - url: '/app/kibana#/dev_tools', - euiIconType: 'devToolsApp', - category: DEFAULT_APP_CATEGORIES.management, - }, { id: 'kibana:stack_management', title: i18n.translate('kbn.managementTitle', { diff --git a/src/legacy/core_plugins/kibana/public/__tests__/discover/doc_table.js b/src/legacy/core_plugins/kibana/public/__tests__/discover/doc_table.js index edf65fdb56220..e4ad8a5638fd1 100644 --- a/src/legacy/core_plugins/kibana/public/__tests__/discover/doc_table.js +++ b/src/legacy/core_plugins/kibana/public/__tests__/discover/doc_table.js @@ -24,6 +24,8 @@ import 'ui/private'; import { pluginInstance } from './legacy'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import hits from 'fixtures/real_hits'; +import { setScopedHistory } from '../../../../../../plugins/discover/public/kibana_services'; +import { createBrowserHistory } from 'history'; let $parentScope; @@ -58,6 +60,7 @@ const destroy = function() { describe('docTable', function() { let $elem; + before(() => setScopedHistory(createBrowserHistory())); beforeEach(() => pluginInstance.initializeInnerAngular()); beforeEach(() => pluginInstance.initializeServices()); beforeEach(ngMock.module('app/discover')); diff --git a/src/legacy/core_plugins/kibana/public/__tests__/discover/row_headers.js b/src/legacy/core_plugins/kibana/public/__tests__/discover/row_headers.js index 5450a4127b63c..2a34ace8f1312 100644 --- a/src/legacy/core_plugins/kibana/public/__tests__/discover/row_headers.js +++ b/src/legacy/core_plugins/kibana/public/__tests__/discover/row_headers.js @@ -25,6 +25,8 @@ import { getFakeRow, getFakeRowVals } from 'fixtures/fake_row'; import $ from 'jquery'; import { pluginInstance } from './legacy'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; +import { setScopedHistory } from '../../../../../../plugins/discover/public/kibana_services'; +import { createBrowserHistory } from 'history'; describe('Doc Table', function() { let $parentScope; @@ -37,6 +39,7 @@ describe('Doc Table', function() { let stubFieldFormatConverter; beforeEach(() => pluginInstance.initializeServices()); beforeEach(() => pluginInstance.initializeInnerAngular()); + before(() => setScopedHistory(createBrowserHistory())); beforeEach(ngMock.module('app/discover')); beforeEach( ngMock.inject(function($rootScope, Private) { diff --git a/src/legacy/core_plugins/kibana/public/dev_tools/README.md b/src/legacy/core_plugins/kibana/public/dev_tools/README.md deleted file mode 100644 index 199ddcc754d04..0000000000000 --- a/src/legacy/core_plugins/kibana/public/dev_tools/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This folder is just a left-over of the things that can't be moved to Kibana platform just yet: - -* Check whether there are no dev tools and hide the link in the nav bar (this can be moved as soon as all dev tools are moved) \ No newline at end of file diff --git a/src/legacy/core_plugins/kibana/public/index.scss b/src/legacy/core_plugins/kibana/public/index.scss index 6a2e65e3a9ff5..56a2543dbca78 100644 --- a/src/legacy/core_plugins/kibana/public/index.scss +++ b/src/legacy/core_plugins/kibana/public/index.scss @@ -11,9 +11,6 @@ // bad cascading in the Editor layout @import '../../../../plugins/maps_legacy/public/index'; -// Home styles -@import '../../../../plugins/home/public/application/index'; - // Management styles @import './management/index'; diff --git a/src/legacy/core_plugins/kibana/public/kibana.js b/src/legacy/core_plugins/kibana/public/kibana.js index 4e97d46ab1773..0bf74edc77cb6 100644 --- a/src/legacy/core_plugins/kibana/public/kibana.js +++ b/src/legacy/core_plugins/kibana/public/kibana.js @@ -21,19 +21,15 @@ // preloading (for faster webpack builds) import routes from 'ui/routes'; -import { uiModules } from 'ui/modules'; import { npSetup } from 'ui/new_platform'; // import the uiExports that we want to "use" -import 'uiExports/home'; -import 'uiExports/visualize'; import 'uiExports/savedObjectTypes'; import 'uiExports/fieldFormatEditors'; import 'uiExports/navbarExtensions'; import 'uiExports/contextMenuActions'; import 'uiExports/managementSections'; import 'uiExports/indexManagement'; -import 'uiExports/docViews'; import 'uiExports/embeddableFactories'; import 'uiExports/embeddableActions'; import 'uiExports/inspectorViews'; @@ -43,8 +39,6 @@ import 'uiExports/interpreter'; import 'ui/autoload/all'; import './management'; -import './dev_tools'; -import { showAppRedirectNotification } from '../../../../plugins/kibana_legacy/public'; import { localApplicationService } from './local_application_service'; npSetup.plugins.kibanaLegacy.registerLegacyAppAlias('doc', 'discover', { keepPrefix: true }); @@ -58,7 +52,3 @@ const { config } = npSetup.plugins.kibanaLegacy; routes.otherwise({ redirectTo: `/${config.defaultAppId || 'discover'}`, }); - -uiModules - .get('kibana') - .run($location => showAppRedirectNotification($location, npSetup.core.notifications.toasts)); diff --git a/src/legacy/core_plugins/kibana/public/local_application_service/local_application_service.ts b/src/legacy/core_plugins/kibana/public/local_application_service/local_application_service.ts index f38c410e6832f..44a3507e57aa5 100644 --- a/src/legacy/core_plugins/kibana/public/local_application_service/local_application_service.ts +++ b/src/legacy/core_plugins/kibana/public/local_application_service/local_application_service.ts @@ -106,7 +106,9 @@ export class LocalApplicationService { template: '', controller($location: ILocationService) { const newPath = forwardDefinition.rewritePath($location.url()); - npStart.core.application.navigateToApp(forwardDefinition.newAppId, { path: newPath }); + window.location.replace( + npStart.core.http.basePath.prepend(`/app/${forwardDefinition.newAppId}${newPath}`) + ); }, }); }); diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap index 1545ab8cb9b1c..9763cd9f638fd 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap @@ -111,6 +111,7 @@ exports[`CreateIndexPatternWizard renders the empty state when there are no indi /> , "learnHowLink": { it('should render normally', () => { - const component = shallow( {}} />); + const component = shallow( {}} prependBasePath={x => x} />); expect(component).toMatchSnapshot(); }); @@ -34,7 +34,9 @@ describe('EmptyState', () => { it('is called when refresh button is clicked', () => { const onRefreshHandler = sinon.stub(); - const component = shallow(); + const component = shallow( + x} /> + ); component.find('[data-test-subj="refreshIndicesButton"]').simulate('click'); diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/empty_state/empty_state.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/empty_state/empty_state.tsx index 676f4d38f409b..3ee5d1a0e96f1 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/empty_state/empty_state.tsx +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/empty_state/empty_state.tsx @@ -22,8 +22,15 @@ import React from 'react'; import { EuiCallOut, EuiTextColor, EuiLink, EuiButton } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; +import { IBasePath } from 'kibana/public'; -export const EmptyState = ({ onRefresh }: { onRefresh: () => void }) => ( +export const EmptyState = ({ + onRefresh, + prependBasePath, +}: { + onRefresh: () => void; + prependBasePath: IBasePath['prepend']; +}) => (
void }) => ( ), learnHowLink: ( - + void }) => ( ), getStartedLink: ( - + x), }; describe('CreateIndexPatternWizard', () => { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx index 4166d48349d35..a1a263fe88923 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx @@ -35,6 +35,7 @@ import { SavedObjectsClient, IUiSettingsClient, OverlayStart, + IBasePath, } from '../../../../../../../../core/public'; import { DataPublicPluginStart } from '../../../../../../../../plugins/data/public'; import { IndexPatternCreationConfig } from '../../../../../../../../plugins/index_pattern_management/public'; @@ -50,6 +51,7 @@ interface CreateIndexPatternWizardProps { uiSettings: IUiSettingsClient; changeUrl: (url: string) => void; openConfirm: OverlayStart['openConfirm']; + prependBasePath: IBasePath['prepend']; }; } @@ -235,7 +237,12 @@ export class CreateIndexPatternWizard extends Component< const hasDataIndices = allIndices.some(({ name }: MatchedIndex) => !name.startsWith('.')); if (!hasDataIndices && !isIncludingSystemIndices && !remoteClustersExist) { - return ; + return ( + + ); } if (step === 1) { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js index ed1fc026c560c..2762a4f6e8726 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js @@ -45,6 +45,7 @@ uiRoutes.when('/management/kibana/index_pattern', { $scope.$evalAsync(() => kbnUrl.changePath(url)); }, openConfirm: npStart.core.overlays.openConfirm, + prependBasePath: npStart.core.http.basePath.prepend, }; const initialQuery = $routeParams.id ? decodeURIComponent($routeParams.id) : undefined; diff --git a/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js b/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js index b06a5b443e709..e5d43fec4e59c 100644 --- a/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js +++ b/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js @@ -85,7 +85,7 @@ const savedObjectsManagement = getManagementaMock({ }, getInAppUrl(obj) { return { - path: `/app/kibana#/visualize/edit/${encodeURIComponent(obj.id)}`, + path: `/app/visualize#/edit/${encodeURIComponent(obj.id)}`, uiCapabilitiesPath: 'visualize.show', }; }, @@ -101,7 +101,7 @@ const savedObjectsManagement = getManagementaMock({ }, getInAppUrl(obj) { return { - path: `/app/kibana#/discover/${encodeURIComponent(obj.id)}`, + path: `/app/discover#//${encodeURIComponent(obj.id)}`, uiCapabilitiesPath: 'discover.show', }; }, @@ -200,7 +200,7 @@ describe('findRelationships', () => { title: 'Foo', editUrl: '/management/kibana/objects/savedVisualizations/1', inAppUrl: { - path: '/app/kibana#/visualize/edit/1', + path: '/app/visualize#/edit/1', uiCapabilitiesPath: 'visualize.show', }, }, @@ -214,7 +214,7 @@ describe('findRelationships', () => { title: 'Bar', editUrl: '/management/kibana/objects/savedVisualizations/2', inAppUrl: { - path: '/app/kibana#/visualize/edit/2', + path: '/app/visualize#/edit/2', uiCapabilitiesPath: 'visualize.show', }, }, @@ -228,7 +228,7 @@ describe('findRelationships', () => { title: 'FooBar', editUrl: '/management/kibana/objects/savedVisualizations/3', inAppUrl: { - path: '/app/kibana#/visualize/edit/3', + path: '/app/visualize#/edit/3', uiCapabilitiesPath: 'visualize.show', }, }, @@ -453,7 +453,7 @@ describe('findRelationships', () => { title: 'Foo', editUrl: '/management/kibana/objects/savedVisualizations/1', inAppUrl: { - path: '/app/kibana#/visualize/edit/1', + path: '/app/visualize#/edit/1', uiCapabilitiesPath: 'visualize.show', }, }, @@ -467,7 +467,7 @@ describe('findRelationships', () => { title: 'Bar', editUrl: '/management/kibana/objects/savedVisualizations/2', inAppUrl: { - path: '/app/kibana#/visualize/edit/2', + path: '/app/visualize#/edit/2', uiCapabilitiesPath: 'visualize.show', }, }, @@ -481,7 +481,7 @@ describe('findRelationships', () => { title: 'FooBar', editUrl: '/management/kibana/objects/savedVisualizations/3', inAppUrl: { - path: '/app/kibana#/visualize/edit/3', + path: '/app/visualize#/edit/3', uiCapabilitiesPath: 'visualize.show', }, }, @@ -567,7 +567,7 @@ describe('findRelationships', () => { title: 'Foo', editUrl: '/management/kibana/objects/savedVisualizations/1', inAppUrl: { - path: '/app/kibana#/visualize/edit/1', + path: '/app/visualize#/edit/1', uiCapabilitiesPath: 'visualize.show', }, }, @@ -581,7 +581,7 @@ describe('findRelationships', () => { title: 'Bar', editUrl: '/management/kibana/objects/savedVisualizations/2', inAppUrl: { - path: '/app/kibana#/visualize/edit/2', + path: '/app/visualize#/edit/2', uiCapabilitiesPath: 'visualize.show', }, }, @@ -595,7 +595,7 @@ describe('findRelationships', () => { title: 'FooBar', editUrl: '/management/kibana/objects/savedVisualizations/3', inAppUrl: { - path: '/app/kibana#/visualize/edit/3', + path: '/app/visualize#/edit/3', uiCapabilitiesPath: 'visualize.show', }, }, @@ -609,7 +609,7 @@ describe('findRelationships', () => { title: 'My Saved Search', editUrl: '/management/kibana/objects/savedSearches/1', inAppUrl: { - path: '/app/kibana#/discover/1', + path: '/app/discover#//1', uiCapabilitiesPath: 'discover.show', }, }, diff --git a/src/legacy/core_plugins/kibana/server/ui_setting_defaults.js b/src/legacy/core_plugins/kibana/server/ui_setting_defaults.js index 91c61886d216c..1a040e236351a 100644 --- a/src/legacy/core_plugins/kibana/server/ui_setting_defaults.js +++ b/src/legacy/core_plugins/kibana/server/ui_setting_defaults.js @@ -69,7 +69,7 @@ export function getUiSettingDefaults() { name: i18n.translate('kbn.advancedSettings.defaultRoute.defaultRouteTitle', { defaultMessage: 'Default route', }), - value: '/app/kibana', + value: '/app/home', schema: schema.string({ validate(value) { if (!value.startsWith('/') || !isRelativeUrl(value)) { diff --git a/src/legacy/ui/public/_index.scss b/src/legacy/ui/public/_index.scss index f10718ba58c2c..15a70e0ef7f5a 100644 --- a/src/legacy/ui/public/_index.scss +++ b/src/legacy/ui/public/_index.scss @@ -11,7 +11,5 @@ @import './accessibility/index'; @import './directives/index'; @import './error_url_overflow/index'; -@import './exit_full_screen/index'; @import './field_editor/index'; -@import './style_compile/index'; @import '../../../plugins/management/public/components/index'; diff --git a/src/legacy/ui/public/autoload/modules.js b/src/legacy/ui/public/autoload/modules.js index b40f051a5ec10..94929c8ca26d3 100644 --- a/src/legacy/ui/public/autoload/modules.js +++ b/src/legacy/ui/public/autoload/modules.js @@ -25,7 +25,6 @@ import '../private'; import '../promises'; import '../state_management/app_state'; import '../state_management/global_state'; -import '../style_compile'; import '../url'; import '../directives/watch_multi'; import '../react_components'; diff --git a/src/legacy/ui/public/chrome/api/__tests__/nav.js b/src/legacy/ui/public/chrome/api/__tests__/nav.js index 853ef4ad0b3dc..877da3539828f 100644 --- a/src/legacy/ui/public/chrome/api/__tests__/nav.js +++ b/src/legacy/ui/public/chrome/api/__tests__/nav.js @@ -112,66 +112,28 @@ describe('chrome nav apis', function() { }); }); - describe('internals.trackPossibleSubUrl()', function() { - it('injects the globalState of the current url to all links for the same app', function() { - const appUrlStore = new StubBrowserStorage(); - fakedLinks = [ - { - id: 'kibana:discover', - baseUrl: `${baseUrl}/app/kibana#discover`, - subUrlBase: '/app/kibana#discover', - legacy: true, - }, - { - id: 'kibana:visualize', - baseUrl: `${baseUrl}/app/kibana#visualize`, - subUrlBase: '/app/kibana#visualize', - legacy: true, - }, - { - id: 'kibana:dashboard', - baseUrl: `${baseUrl}/app/kibana#dashboards`, - subUrlBase: '/app/kibana#dashboard', - legacy: true, - }, - ]; - - const { internals } = init({ appUrlStore }); - internals.trackPossibleSubUrl(`${baseUrl}/app/kibana#dashboard?_g=globalstate`); - - expect(fakedLinks[0].url).to.be(`${baseUrl}/app/kibana#discover?_g=globalstate`); - expect(fakedLinks[0].active).to.be(false); - - expect(fakedLinks[1].url).to.be(`${baseUrl}/app/kibana#visualize?_g=globalstate`); - expect(fakedLinks[1].active).to.be(false); - - expect(fakedLinks[2].url).to.be(`${baseUrl}/app/kibana#dashboard?_g=globalstate`); - expect(fakedLinks[2].active).to.be(true); - }); - }); - describe('chrome.trackSubUrlForApp()', function() { it('injects a manual app url', function() { const appUrlStore = new StubBrowserStorage(); fakedLinks = [ { - id: 'kibana:visualize', - baseUrl: `${baseUrl}/app/kibana#visualize`, - url: `${baseUrl}/app/kibana#visualize`, - subUrlBase: '/app/kibana#visualize', + id: 'visualize', + baseUrl: `${baseUrl}/app/visualize#`, + url: `${baseUrl}/app/visualize#`, + subUrlBase: '/app/visualize#', legacy: true, }, ]; const { chrome } = init({ appUrlStore }); const kibanaParsedUrl = absoluteToParsedUrl( - `${baseUrl}/xyz/app/kibana#visualize/1234?_g=globalstate`, + `${baseUrl}/xyz/app/visualize#/1234?_g=globalstate`, '/xyz' ); - chrome.trackSubUrlForApp('kibana:visualize', kibanaParsedUrl); + chrome.trackSubUrlForApp('visualize', kibanaParsedUrl); expect( - coreNavLinks.update.calledWith('kibana:visualize', { - url: `${baseUrl}/xyz/app/kibana#visualize/1234?_g=globalstate`, + coreNavLinks.update.calledWith('visualize', { + url: `${baseUrl}/xyz/app/visualize#/1234?_g=globalstate`, }) ).to.be(true); }); diff --git a/src/legacy/ui/public/new_platform/new_platform.karma_mock.js b/src/legacy/ui/public/new_platform/new_platform.karma_mock.js index 332a0a0f9ca6e..67422fa659439 100644 --- a/src/legacy/ui/public/new_platform/new_platform.karma_mock.js +++ b/src/legacy/ui/public/new_platform/new_platform.karma_mock.js @@ -357,9 +357,6 @@ export const npStart = { registerRenderer: sinon.fake(), registerType: sinon.fake(), }, - devTools: { - getSortedDevTools: () => [], - }, kibanaLegacy: { getApps: () => [], getForwards: () => [], diff --git a/src/legacy/ui/public/new_platform/new_platform.ts b/src/legacy/ui/public/new_platform/new_platform.ts index 1eb46e1a43895..ddf768495a9da 100644 --- a/src/legacy/ui/public/new_platform/new_platform.ts +++ b/src/legacy/ui/public/new_platform/new_platform.ts @@ -39,7 +39,7 @@ import { Start as InspectorStart, } from '../../../../plugins/inspector/public'; import { ChartsPluginSetup, ChartsPluginStart } from '../../../../plugins/charts/public'; -import { DevToolsSetup, DevToolsStart } from '../../../../plugins/dev_tools/public'; +import { DevToolsSetup } from '../../../../plugins/dev_tools/public'; import { KibanaLegacySetup, KibanaLegacyStart } from '../../../../plugins/kibana_legacy/public'; import { HomePublicPluginSetup } from '../../../../plugins/home/public'; import { SharePluginSetup, SharePluginStart } from '../../../../plugins/share/public'; @@ -105,7 +105,6 @@ export interface PluginsStart { inspector: InspectorStart; uiActions: UiActionsStart; navigation: NavigationPublicPluginStart; - devTools: DevToolsStart; kibanaLegacy: KibanaLegacyStart; share: SharePluginStart; management: ManagementStart; diff --git a/src/legacy/ui/public/new_platform/set_services.ts b/src/legacy/ui/public/new_platform/set_services.ts index 9cacb0c09d79a..9d02ad67b3937 100644 --- a/src/legacy/ui/public/new_platform/set_services.ts +++ b/src/legacy/ui/public/new_platform/set_services.ts @@ -64,6 +64,7 @@ export function setStartServices(npStart: NpStart) { ); visualizationsServices.setCapabilities(npStart.core.application.capabilities); visualizationsServices.setHttp(npStart.core.http); + visualizationsServices.setApplication(npStart.core.application); visualizationsServices.setSavedObjects(npStart.core.savedObjects); visualizationsServices.setIndexPatterns(npStart.plugins.data.indexPatterns); visualizationsServices.setFilterManager(npStart.plugins.data.query.filterManager); diff --git a/src/legacy/ui/public/style_compile/__tests__/style_compile.js b/src/legacy/ui/public/style_compile/__tests__/style_compile.js deleted file mode 100644 index 329177f67539b..0000000000000 --- a/src/legacy/ui/public/style_compile/__tests__/style_compile.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import $ from 'jquery'; -import expect from '@kbn/expect'; -import ngMock from 'ng_mock'; -describe('styleCompile directive', function() { - let config; - let $rootScope; - - beforeEach(ngMock.module('kibana')); - beforeEach( - ngMock.inject(function($injector) { - config = $injector.get('config'); - $rootScope = $injector.get('$rootScope'); - }) - ); - - it('exports a few config values as css', function() { - const $style = $('#style-compile'); - - config.set('truncate:maxHeight', 0); - $rootScope.$apply(); - expect($style.html().trim()).to.be( - [ - '.truncate-by-height {', - ' max-height: none;', - ' display: inline-block;', - '}', - '.truncate-by-height:before {', - ' top: -15px;', - '}', - ].join('\n') - ); - - config.set('truncate:maxHeight', 15); - $rootScope.$apply(); - expect($style.html().trim()).to.be( - [ - '.truncate-by-height {', - ' max-height: 15px !important;', - ' display: inline-block;', - '}', - '.truncate-by-height:before {', - ' top: 0px;', - '}', - ].join('\n') - ); - }); -}); diff --git a/src/legacy/ui/public/style_compile/_index.scss b/src/legacy/ui/public/style_compile/_index.scss deleted file mode 100644 index 6dd403d730314..0000000000000 --- a/src/legacy/ui/public/style_compile/_index.scss +++ /dev/null @@ -1,3 +0,0 @@ -style-compile { - display: none; -} diff --git a/src/legacy/ui/public/style_compile/style_compile.css.tmpl b/src/legacy/ui/public/style_compile/style_compile.css.tmpl deleted file mode 100644 index 943b459acc565..0000000000000 --- a/src/legacy/ui/public/style_compile/style_compile.css.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -.truncate-by-height { - max-height: <%= truncateMaxHeight %>; - display: inline-block; -} -.truncate-by-height:before { - top: <%= truncateGradientTop %>; -} diff --git a/src/legacy/ui/public/style_compile/style_compile.js b/src/legacy/ui/public/style_compile/style_compile.js deleted file mode 100644 index 5b53947e6eb00..0000000000000 --- a/src/legacy/ui/public/style_compile/style_compile.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import _ from 'lodash'; -import $ from 'jquery'; -import '../config'; -import { uiModules } from '../modules'; -import cssTmpl from './style_compile.css.tmpl'; - -const $style = $('