From 8067bd0ffc8d5a838e4862f7957f9896f4a7275c Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Thu, 21 Nov 2019 13:43:47 +0100 Subject: [PATCH] Fix usage of feature catalogue and fix time buckets types --- src/legacy/ui/public/time_buckets/index.d.ts | 22 +++++++++++++++++++ x-pack/legacy/plugins/watcher/kibana.json | 2 +- .../watcher/public/register_feature.ts | 8 +++---- 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 src/legacy/ui/public/time_buckets/index.d.ts diff --git a/src/legacy/ui/public/time_buckets/index.d.ts b/src/legacy/ui/public/time_buckets/index.d.ts new file mode 100644 index 00000000000000..70b9495b81f0eb --- /dev/null +++ b/src/legacy/ui/public/time_buckets/index.d.ts @@ -0,0 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +declare module 'ui/time_buckets' { + export const TimeBuckets: any; +} diff --git a/x-pack/legacy/plugins/watcher/kibana.json b/x-pack/legacy/plugins/watcher/kibana.json index 09a30253e21d6a..ccec8a1b776836 100644 --- a/x-pack/legacy/plugins/watcher/kibana.json +++ b/x-pack/legacy/plugins/watcher/kibana.json @@ -2,7 +2,7 @@ "id": "watcher", "version": "kibana", "requiredPlugins": [ - "feature_catalogue" + "home" ], "server": true, "ui": true diff --git a/x-pack/legacy/plugins/watcher/public/register_feature.ts b/x-pack/legacy/plugins/watcher/public/register_feature.ts index ea4b80f1a3db62..0de41e09f788e1 100644 --- a/x-pack/legacy/plugins/watcher/public/register_feature.ts +++ b/x-pack/legacy/plugins/watcher/public/register_feature.ts @@ -6,18 +6,16 @@ import { i18n } from '@kbn/i18n'; import { npSetup } from 'ui/new_platform'; +import { FeatureCatalogueCategory } from 'ui/registry/feature_catalogue'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { FeatureCatalogueCategory } from '../../../../../src/plugins/feature_catalogue/public/services'; - -npSetup.plugins.feature_catalogue.register({ +npSetup.plugins.home.featureCatalogue.register({ id: 'watcher', title: 'Watcher', // This is a product name so we don't translate it. + category: FeatureCatalogueCategory.ADMIN, description: i18n.translate('xpack.watcher.watcherDescription', { defaultMessage: 'Detect changes in your data by creating, managing, and monitoring alerts.', }), icon: 'watchesApp', path: '/app/kibana#/management/elasticsearch/watcher/watches', showOnHomePage: true, - category: FeatureCatalogueCategory.ADMIN, });