Skip to content

Commit

Permalink
Register maps embeddable in NP plugin setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Caldwell committed Jan 16, 2020
1 parent 89e79aa commit 54eee3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -146,5 +145,3 @@ export class MapEmbeddableFactory extends EmbeddableFactory {
);
}
}

setup.registerEmbeddableFactory(MAP_SAVED_OBJECT_TYPE, new MapEmbeddableFactory());
8 changes: 7 additions & 1 deletion x-pack/legacy/plugins/maps/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,9 +29,11 @@ export class MapsPlugin implements Plugin<MapsPluginSetup, MapsPluginStart> {
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) {
Expand Down

0 comments on commit 54eee3e

Please sign in to comment.