Skip to content

Commit

Permalink
use np method
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Sep 1, 2020
1 parent 08c14f3 commit f8a0289
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions x-pack/plugins/maps/public/routing/routes/list/maps_list_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
getUiSettings,
getToasts,
getCoreChrome,
getHttp,
getNavigateToApp,
} from '../../../kibana_services';
import {
EuiTitle,
Expand All @@ -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,
Expand Down Expand Up @@ -388,9 +395,8 @@ export class MapsListView extends React.Component {
renderListing() {
let createButton;
if (!this.state.readOnly) {
const newMap = getHttp().basePath.prepend(getNewMapPath());
createButton = (
<EuiButton data-test-subj="newMapLink" fill href={newMap}>
<EuiButton data-test-subj="newMapLink" onClick={navigateToNewMap}>
<FormattedMessage
id="xpack.maps.mapListing.createMapButtonLabel"
defaultMessage="Create map"
Expand Down

0 comments on commit f8a0289

Please sign in to comment.