diff --git a/x-pack/legacy/plugins/maps/check_license.js b/x-pack/legacy/plugins/maps/check_license.js deleted file mode 100644 index 9e5397ee5dc75..0000000000000 --- a/x-pack/legacy/plugins/maps/check_license.js +++ /dev/null @@ -1,38 +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. - */ - -/** - * on the license information extracted from the xPackInfo. - * @param {XPackInfo} xPackInfo XPackInfo instance to extract license information from. - * @returns {LicenseCheckResult} - */ -export function checkLicense(xPackInfo) { - if (!xPackInfo.isAvailable()) { - return { - maps: false, - }; - } - - const isAnyXpackLicense = xPackInfo.license.isOneOf([ - 'basic', - 'standard', - 'gold', - 'platinum', - 'enterprise', - 'trial', - ]); - - if (!isAnyXpackLicense) { - return { - maps: false, - }; - } - - return { - maps: true, - uid: xPackInfo.license.getUid(), - }; -} 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 f56b0ba7188aa..73f222615493b 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 @@ -23,7 +23,7 @@ import { getQueryableUniqueIndexPatternIds } from '../selectors/map_selectors'; import { getInitialLayers } from '../angular/get_initial_layers'; import { mergeInputWithSavedMap } from './merge_input_with_saved_map'; import '../angular/services/gis_map_saved_object_loader'; -import { bindCoreAndPlugins } from '../plugin'; +import { bindSetupCoreAndPlugins } from '../plugin'; import { npSetup } from 'ui/new_platform'; export class MapEmbeddableFactory extends EmbeddableFactory { @@ -39,7 +39,7 @@ export class MapEmbeddableFactory extends EmbeddableFactory { getIconForSavedObject: () => APP_ICON, }, }); - bindCoreAndPlugins(npSetup.core, npSetup.plugins); + bindSetupCoreAndPlugins(npSetup.core, npSetup.plugins); } isEditable() { return capabilities.get().maps.save; diff --git a/x-pack/legacy/plugins/maps/public/plugin.ts b/x-pack/legacy/plugins/maps/public/plugin.ts index abe148ef8eae1..190774354a02d 100644 --- a/x-pack/legacy/plugins/maps/public/plugin.ts +++ b/x-pack/legacy/plugins/maps/public/plugin.ts @@ -31,9 +31,8 @@ interface MapsPluginSetupDependencies { }; } -export const bindCoreAndPlugins = (core, plugins) => { - const { licensing, inspector } = plugins; - setInspector(inspector); +export const bindSetupCoreAndPlugins = (core, plugins) => { + const { licensing } = plugins; if (licensing) { licensing.license$.subscribe(({ uid }) => setLicenseId(uid)); } @@ -48,10 +47,12 @@ export class MapsPlugin implements Plugin { return reactDirective(wrapInI18nContext(MapListing)); }); - bindCoreAndPlugins(core, np); + bindSetupCoreAndPlugins(core, np); np.home.featureCatalogue.register(featureCatalogueEntry); } - public start(core: CoreStart, plugins: any) {} + public start(core: CoreStart, plugins: any) { + setInspector(plugins.np.inspector); + } }