kibana/x-pack/plugins/lens/public/vis_type_alias.ts
Tim Roes ebbc062689
Move Lens frontend to Kibana Platform (#62965)
* Move Lens frontend to Kibana platform

* Fix line breaks

* Fix jest tests

* Fix remaining test

* Remove old Lens plugin entry

* Fix i18n prefix

* Add config schema

* Address review
2020-04-15 12:22:37 +02:00

50 lines
1.6 KiB
TypeScript

/*
* 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 { VisTypeAlias } from 'src/plugins/visualizations/public';
import { getBasePath, getEditPath } from '../common';
export const getLensAliasConfig = (): VisTypeAlias => ({
aliasUrl: getBasePath(),
name: 'lens',
promotion: {
description: i18n.translate('xpack.lens.visTypeAlias.promotion.description', {
defaultMessage: 'Try Lens, our new, intuitive way to create visualizations.',
}),
buttonText: i18n.translate('xpack.lens.visTypeAlias.promotion.buttonText', {
defaultMessage: 'Go to Lens',
}),
},
title: i18n.translate('xpack.lens.visTypeAlias.title', {
defaultMessage: 'Lens',
}),
description: i18n.translate('xpack.lens.visTypeAlias.description', {
defaultMessage: `Lens is a simpler way to create basic visualizations`,
}),
icon: 'lensApp',
stage: 'beta',
appExtensions: {
visualizations: {
docTypes: ['lens'],
searchFields: ['title^3'],
toListItem(savedObject) {
const { id, type, attributes } = savedObject;
const { title } = attributes as { title: string };
return {
id,
title,
editUrl: getEditPath(id),
icon: 'lensApp',
stage: 'beta',
savedObjectType: type,
typeTitle: i18n.translate('xpack.lens.visTypeAlias.type', { defaultMessage: 'Lens' }),
};
},
},
},
});