Skip to content

Commit

Permalink
Revert view registration to a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
maryia-lapata committed Jan 27, 2020
1 parent 0a3e4b4 commit 93ddaf1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions x-pack/legacy/plugins/maps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function maps(kibana) {
};
},
embeddableFactories: ['plugins/maps/embeddable/map_embeddable_factory'],
inspectorViews: ['plugins/maps/inspector/views/register_views'],
home: ['plugins/maps/register_feature'],
styleSheetPaths: `${__dirname}/public/index.scss`,
savedObjectSchemas: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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 } from 'ui/new_platform';

// @ts-ignore
import { MapView } from './map_view';

npSetup.plugins.inspector.registerView(MapView);
6 changes: 1 addition & 5 deletions x-pack/legacy/plugins/maps/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { wrapInI18nContext } from 'ui/i18n';
import { MapListing } from './components/map_listing';
// @ts-ignore
import { setLicenseId, setInspector } from './kibana_services';
// @ts-ignore
import { MapView } from './inspector/views/map_view';

/**
* These are the interfaces with your public contracts. You should export these
Expand All @@ -27,7 +25,7 @@ export class MapsPlugin implements Plugin<MapsPluginSetup, MapsPluginStart> {
public setup(core: any, plugins: any) {
const {
__LEGACY: { uiModules },
np: { licensing, inspector },
np: { licensing },
} = plugins;

uiModules
Expand All @@ -39,8 +37,6 @@ export class MapsPlugin implements Plugin<MapsPluginSetup, MapsPluginStart> {
if (licensing) {
licensing.license$.subscribe(({ uid }: { uid: string }) => setLicenseId(uid));
}

inspector.registerView(MapView);
}

public start(core: CoreStart, plugins: any) {
Expand Down

0 comments on commit 93ddaf1

Please sign in to comment.