From f8a0289ba412d80c9b06228bc647529e9cf0ab36 Mon Sep 17 00:00:00 2001 From: Thomas Neirynck Date: Tue, 1 Sep 2020 16:25:53 -0400 Subject: [PATCH] use np method --- .../public/routing/routes/list/maps_list_view.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/maps/public/routing/routes/list/maps_list_view.js b/x-pack/plugins/maps/public/routing/routes/list/maps_list_view.js index 31efdd90f19a25..758dda0678e141 100644 --- a/x-pack/plugins/maps/public/routing/routes/list/maps_list_view.js +++ b/x-pack/plugins/maps/public/routing/routes/list/maps_list_view.js @@ -12,7 +12,7 @@ import { getUiSettings, getToasts, getCoreChrome, - getHttp, + getNavigateToApp, } from '../../../kibana_services'; import { EuiTitle, @@ -34,10 +34,17 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { addHelpMenuToAppChrome } from '../../../help_menu_util'; import { goToSpecifiedPath } from '../../maps_router'; -import { getNewMapPath } from '../../../../common/constants'; +import { APP_ID, MAP_PATH } from '../../../../common/constants'; export const EMPTY_FILTER = ''; +function navigateToNewMap() { + const navigateToApp = getNavigateToApp(); + navigateToApp(APP_ID, { + path: MAP_PATH, + }); +} + export class MapsListView extends React.Component { state = { hasInitialFetchReturned: false, @@ -388,9 +395,8 @@ export class MapsListView extends React.Component { renderListing() { let createButton; if (!this.state.readOnly) { - const newMap = getHttp().basePath.prepend(getNewMapPath()); createButton = ( - +