From 4cb4e5e524b806d556bc1cafb3402b53bf9cec67 Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Mon, 13 Jan 2020 15:14:27 +0100 Subject: [PATCH] Migrate feature registration to NP --- .../public/register_feature.ts | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/x-pack/legacy/plugins/painless_playground/public/register_feature.ts b/x-pack/legacy/plugins/painless_playground/public/register_feature.ts index d4006ce23cb18..c39aad88e8caa 100644 --- a/x-pack/legacy/plugins/painless_playground/public/register_feature.ts +++ b/x-pack/legacy/plugins/painless_playground/public/register_feature.ts @@ -4,25 +4,20 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; - import { i18n } from '@kbn/i18n'; +import { npSetup } from 'ui/new_platform'; +import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; -FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'painless_playground', - title: i18n.translate('xpack.painlessPlayground.registryProviderTitle', { - defaultMessage: 'Painless Playground', - }), - description: i18n.translate('xpack.painlessPlayground.registryProviderDescription', { - defaultMessage: 'Simulate and debug painless code', - }), - icon: '', - path: '/app/kibana#/dev_tools/painless_playground', - showOnHomePage: false, - category: FeatureCatalogueCategory.ADMIN, - }; +npSetup.plugins.home.featureCatalogue.register({ + id: 'painless_playground', + title: i18n.translate('xpack.painlessPlayground.registryProviderTitle', { + defaultMessage: 'Painless Playground', + }), + description: i18n.translate('xpack.painlessPlayground.registryProviderDescription', { + defaultMessage: 'Simulate and debug painless code', + }), + icon: '', + path: '/app/kibana#/dev_tools/painless_playground', + showOnHomePage: false, + category: FeatureCatalogueCategory.ADMIN, });