Skip to content

Commit

Permalink
[Maps] fix use correct mount-context
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Oct 6, 2020
1 parent 4d58a00 commit aedc6a3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/maps/public/lazy_load_bundle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { AnyAction } from 'redux';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { IndexPatternsContract } from 'src/plugins/data/public/index_patterns';
import { AppMountContext, AppMountParameters } from 'kibana/public';
import { AppMountParameters } from 'kibana/public';
import { IndexPattern } from 'src/plugins/data/public';
import { Embeddable, IContainer } from '../../../../../src/plugins/embeddable/public';
import { LayerDescriptor } from '../../common/descriptor_types';
Expand Down Expand Up @@ -40,7 +40,7 @@ interface LazyLoadedMapModules {
initialLayers?: LayerDescriptor[]
) => LayerDescriptor[];
mergeInputWithSavedMap: any;
renderApp: (context: AppMountContext, params: AppMountParameters) => Promise<() => void>;
renderApp: (params: AppMountParameters) => Promise<() => void>;
createSecurityLayerDescriptors: (
indexPatternId: string,
indexPatternTitle: string
Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugins/maps/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { UiActionsStart } from 'src/plugins/ui_actions/public';
import { NavigationPublicPluginStart } from 'src/plugins/navigation/public';
import { Start as InspectorStartContract } from 'src/plugins/inspector/public';
import {
AppMountParameters,
CoreSetup,
CoreStart,
Plugin,
Expand Down Expand Up @@ -131,9 +132,9 @@ export class MapsPlugin
icon: `plugins/${APP_ID}/icon.svg`,
euiIconType: APP_ICON_SOLUTION,
category: DEFAULT_APP_CATEGORIES.kibana,
async mount(context, params) {
async mount(params: AppMountParameters) {
const { renderApp } = await lazyLoadMapModules();
return renderApp(context, params);
return renderApp(params);
},
});
}
Expand Down
13 changes: 8 additions & 5 deletions x-pack/plugins/maps/public/routing/maps_router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { render, unmountComponentAtNode } from 'react-dom';
import { Router, Switch, Route, Redirect, RouteComponentProps } from 'react-router-dom';
import { i18n } from '@kbn/i18n';
import { Provider } from 'react-redux';
import { AppMountContext, AppMountParameters } from 'kibana/public';
import { AppMountParameters } from 'kibana/public';
import {
getCoreChrome,
getCoreI18n,
Expand All @@ -29,10 +29,13 @@ import { LoadMapAndRender } from './routes/maps_app/load_map_and_render';
export let goToSpecifiedPath: (path: string) => void;
export let kbnUrlStateStorage: IKbnUrlStateStorage;

export async function renderApp(
context: AppMountContext,
{ appBasePath, element, history, onAppLeave, setHeaderActionMenu }: AppMountParameters
) {
export async function renderApp({
appBasePath,
element,
history,
onAppLeave,
setHeaderActionMenu,
}: AppMountParameters) {
goToSpecifiedPath = (path) => history.push(path);
kbnUrlStateStorage = createKbnUrlStateStorage({
useHash: false,
Expand Down

0 comments on commit aedc6a3

Please sign in to comment.