From 54eee3e230242c42d3a7fcf1862ec7496bf7fbb3 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Thu, 16 Jan 2020 16:28:41 -0700 Subject: [PATCH] Register maps embeddable in NP plugin setup --- .../maps/public/embeddable/map_embeddable_factory.js | 3 --- x-pack/legacy/plugins/maps/public/plugin.ts | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js index ec3a588d3627f..9cbaabaaf6946 100644 --- a/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js +++ b/x-pack/legacy/plugins/maps/public/embeddable/map_embeddable_factory.js @@ -12,7 +12,6 @@ import { EmbeddableFactory, ErrorEmbeddable, } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; -import { setup } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; import { MapEmbeddable } from './map_embeddable'; import { indexPatternService } from '../kibana_services'; @@ -146,5 +145,3 @@ export class MapEmbeddableFactory extends EmbeddableFactory { ); } } - -setup.registerEmbeddableFactory(MAP_SAVED_OBJECT_TYPE, new MapEmbeddableFactory()); diff --git a/x-pack/legacy/plugins/maps/public/plugin.ts b/x-pack/legacy/plugins/maps/public/plugin.ts index 0df7109852486..9d9ce79b0a43d 100644 --- a/x-pack/legacy/plugins/maps/public/plugin.ts +++ b/x-pack/legacy/plugins/maps/public/plugin.ts @@ -11,6 +11,10 @@ import { wrapInI18nContext } from 'ui/i18n'; import { MapListing } from './components/map_listing'; // @ts-ignore import { setLicenseId } from './kibana_services'; +// @ts-ignore +import { MapEmbeddableFactory } from './embeddable/map_embeddable_factory.js'; +// @ts-ignore +import { MAP_SAVED_OBJECT_TYPE } from '../common/constants'; /** * These are the interfaces with your public contracts. You should export these @@ -25,9 +29,11 @@ export class MapsPlugin implements Plugin { public setup(core: any, plugins: any) { const { __LEGACY: { uiModules }, - np: { licensing }, + np: { licensing, embeddable }, } = plugins; + embeddable.registerEmbeddableFactory(MAP_SAVED_OBJECT_TYPE, new MapEmbeddableFactory()); + uiModules .get('app/maps', ['ngRoute', 'react']) .directive('mapListing', function(reactDirective: any) {