forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maps] Get basic structure of NP client shim in place (elastic#52551) (…
…elastic#52837) * Move ui routes init to separate file * Add index and general maps plugin template * Add legacy shim. Pass uimodules in as legacy service * Move ts-ignore * Fix N/A ts error on uiModules * Point index file toward legacy file. Minor NP additions
- Loading branch information
Aaron Caldwell
authored
Dec 12, 2019
1 parent
2249908
commit e740133
Showing
6 changed files
with
88 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import './kibana_services'; | ||
|
||
// import the uiExports that we want to "use" | ||
import 'uiExports/inspectorViews'; | ||
import 'uiExports/search'; | ||
import 'uiExports/embeddableFactories'; | ||
import 'uiExports/embeddableActions'; | ||
import 'ui/agg_types'; | ||
|
||
import 'ui/kbn_top_nav'; | ||
import 'ui/autoload/all'; | ||
import 'react-vis/dist/style.css'; | ||
|
||
import './angular/services/gis_map_saved_object_loader'; | ||
import './angular/map_controller'; | ||
import './routes'; | ||
// @ts-ignore | ||
import { PluginInitializerContext } from 'kibana/public'; | ||
import { MapsPlugin } from './plugin'; | ||
|
||
export const plugin = (initializerContext: PluginInitializerContext) => { | ||
return new MapsPlugin(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { npSetup, npStart } from 'ui/new_platform'; | ||
// @ts-ignore Untyped Module | ||
import { uiModules } from 'ui/modules'; | ||
import { PluginInitializerContext } from 'kibana/public'; // eslint-disable-line import/order | ||
import { plugin } from '.'; | ||
|
||
const pluginInstance = plugin({} as PluginInitializerContext); | ||
|
||
const setupPlugins = { | ||
__LEGACY: { | ||
uiModules, | ||
}, | ||
plugins: npSetup.plugins, | ||
}; | ||
|
||
const startPlugins = { | ||
plugins: npStart.plugins, | ||
}; | ||
|
||
export const setup = pluginInstance.setup(npSetup.core, setupPlugins); | ||
export const start = pluginInstance.start(npStart.core, startPlugins); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { Plugin, CoreStart } from 'src/core/public'; | ||
// @ts-ignore | ||
import { wrapInI18nContext } from 'ui/i18n'; | ||
// @ts-ignore | ||
import { MapListing } from './components/map_listing'; | ||
|
||
/** | ||
* These are the interfaces with your public contracts. You should export these | ||
* for other plugins to use in _their_ `SetupDeps`/`StartDeps` interfaces. | ||
* @public | ||
*/ | ||
export type MapsPluginSetup = ReturnType<MapsPlugin['setup']>; | ||
export type MapsPluginStart = ReturnType<MapsPlugin['start']>; | ||
|
||
/** @internal */ | ||
export class MapsPlugin implements Plugin<MapsPluginSetup, MapsPluginStart> { | ||
public setup(core: any, plugins: any) { | ||
const app = plugins.__LEGACY.uiModules.get('app/maps', ['ngRoute', 'react']); | ||
app.directive('mapListing', function(reactDirective: any) { | ||
return reactDirective(wrapInI18nContext(MapListing)); | ||
}); | ||
} | ||
|
||
public start(core: CoreStart, plugins: any) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters