From e2dc494c94b0043b78ee3c53473ea3ed184b7405 Mon Sep 17 00:00:00 2001 From: Wylie Conlon Date: Tue, 9 Jul 2019 13:48:53 -0400 Subject: [PATCH] [lens] Include link to lens from Visualize (#40542) --- x-pack/legacy/plugins/lens/index.ts | 2 +- x-pack/legacy/plugins/lens/public/index.ts | 1 - .../lens/public/register_vis_type_alias.ts | 22 +++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 x-pack/legacy/plugins/lens/public/register_vis_type_alias.ts diff --git a/x-pack/legacy/plugins/lens/index.ts b/x-pack/legacy/plugins/lens/index.ts index 33cf892435708..88a1b25fc4e39 100644 --- a/x-pack/legacy/plugins/lens/index.ts +++ b/x-pack/legacy/plugins/lens/index.ts @@ -9,7 +9,6 @@ import { Server } from 'hapi'; import { resolve } from 'path'; import { LegacyPluginInitializer } from 'src/legacy/types'; import mappings from './mappings.json'; - import { PLUGIN_ID } from './common'; const NOT_INTERNATIONALIZED_PRODUCT_NAME = 'Lens Visualizations'; @@ -29,6 +28,7 @@ export const lens: LegacyPluginInitializer = kibana => { }, styleSheetPaths: resolve(__dirname, 'public/index.scss'), mappings, + visTypes: ['plugins/lens/register_vis_type_alias'], savedObjectsManagement: { lens: { defaultSearchField: 'title', diff --git a/x-pack/legacy/plugins/lens/public/index.ts b/x-pack/legacy/plugins/lens/public/index.ts index 532b6e66d2b27..c71a3adf22485 100644 --- a/x-pack/legacy/plugins/lens/public/index.ts +++ b/x-pack/legacy/plugins/lens/public/index.ts @@ -17,7 +17,6 @@ import { render, unmountComponentAtNode } from 'react-dom'; import { IScope } from 'angular'; import chrome from 'ui/chrome'; import { appSetup, appStop } from './app_plugin'; - import { PLUGIN_ID } from '../common'; // TODO: Convert this to the "new platform" way of doing UI diff --git a/x-pack/legacy/plugins/lens/public/register_vis_type_alias.ts b/x-pack/legacy/plugins/lens/public/register_vis_type_alias.ts new file mode 100644 index 0000000000000..595eb4d0e350b --- /dev/null +++ b/x-pack/legacy/plugins/lens/public/register_vis_type_alias.ts @@ -0,0 +1,22 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { visualizations } from '../../../../../src/legacy/core_plugins/visualizations/public'; + +const NOT_INTERNATIONALIZED_PRODUCT_NAME = 'Lens Visualizations'; + +visualizations.types.visTypeAliasRegistry.add({ + aliasUrl: '/app/lens/', + name: NOT_INTERNATIONALIZED_PRODUCT_NAME, + title: i18n.translate('xpack.lens.visTypeAlias.title', { + defaultMessage: 'Lens Visualizations', + }), + description: i18n.translate('xpack.lens.visTypeAlias.description', { + defaultMessage: `Lens is a simpler way to create basic visualizations`, + }), + icon: 'faceHappy', +});