[Maps] Migrate Maps embeddables to NP (#63976)

* Migrate maps embeddables. Clean up legacy presence

* Fix type error

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Aaron Caldwell 2020-04-23 16:30:32 -06:00 committed by GitHub
parent 9ad8b8f35f
commit 97c7127589
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 33 deletions

View file

@ -57,7 +57,6 @@ export function maps(kibana) {
tilemap: _.get(mapConfig, 'tilemap', []),
};
},
embeddableFactories: ['plugins/maps/embeddable/map_embeddable_factory'],
styleSheetPaths: `${__dirname}/public/index.scss`,
savedObjectSchemas: {
'maps-telemetry': {

View file

@ -1,30 +0,0 @@
/*
* 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.
*/
/*
Maintain legacy embeddable legacy present while apps switch over
*/
import { npSetup, npStart } from 'ui/new_platform';
import {
bindSetupCoreAndPlugins,
bindStartCoreAndPlugins,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../plugins/maps/public/plugin';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { MAP_SAVED_OBJECT_TYPE } from '../../../../../plugins/maps/common/constants';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { MapEmbeddableFactory } from '../../../../../plugins/maps/public/embeddable';
bindSetupCoreAndPlugins(npSetup.core, npSetup.plugins);
bindStartCoreAndPlugins(npStart.core, npStart.plugins);
export * from '../../../../../plugins/maps/public/embeddable/map_embeddable_factory';
npSetup.plugins.embeddable.registerEmbeddableFactory(
MAP_SAVED_OBJECT_TYPE,
new MapEmbeddableFactory()
);

View file

@ -5,12 +5,14 @@
"configPath": ["xpack", "maps"],
"requiredPlugins": [
"inspector",
"licensing",
"home",
"data",
"fileUpload",
"uiActions",
"navigation",
"visualizations"
"visualizations",
"embeddable"
],
"ui": true
}

View file

@ -39,11 +39,15 @@ import { getMapsVisTypeAlias } from './maps_vis_type_alias';
import { registerLayerWizards } from './layers/load_layer_wizards';
import { HomePublicPluginSetup } from '../../../../src/plugins/home/public';
import { VisualizationsSetup } from '../../../../src/plugins/visualizations/public';
import { MAP_SAVED_OBJECT_TYPE } from '../common/constants';
import { MapEmbeddableFactory } from './embeddable';
import { EmbeddableSetup } from '../../../../src/plugins/embeddable/public';
export interface MapsPluginSetupDependencies {
inspector: InspectorSetupContract;
home: HomePublicPluginSetup;
visualizations: VisualizationsSetup;
embeddable: EmbeddableSetup;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface MapsPluginStartDependencies {}
@ -102,12 +106,13 @@ export class MapsPlugin
MapsPluginStartDependencies
> {
public setup(core: CoreSetup, plugins: MapsPluginSetupDependencies) {
const { inspector, home, visualizations } = plugins;
const { inspector, home, visualizations, embeddable } = plugins;
bindSetupCoreAndPlugins(core, plugins);
inspector.registerView(MapView);
home.featureCatalogue.register(featureCatalogueEntry);
visualizations.registerAlias(getMapsVisTypeAlias());
embeddable.registerEmbeddableFactory(MAP_SAVED_OBJECT_TYPE, new MapEmbeddableFactory());
}
public start(core: CoreStart, plugins: any) {