kibana/x-pack/plugins/canvas/index.js
Tyler Smalley b93b868b0f
Moves styleSheetPath to uiExports (#23007) (#23385)
This was previously defined in uiExports.app, which limited plugins which are not an app of providing a stylesheet. This allows any plugin to define a stylesheet which will be available on page load.
2018-09-20 20:42:04 -07:00

46 lines
1.3 KiB
JavaScript

/*
* 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 { resolve } from 'path';
import init from './init';
import { mappings } from './server/mappings';
import { CANVAS_APP } from './common/lib/constants';
export function canvas(kibana) {
return new kibana.Plugin({
id: CANVAS_APP,
configPrefix: 'xpack.canvas',
require: ['kibana', 'elasticsearch', 'xpack_main'],
publicDir: resolve(__dirname, 'public'),
uiExports: {
app: {
title: 'Canvas',
description: 'Data driven workpads',
icon: 'plugins/canvas/icon.svg',
main: 'plugins/canvas/app',
},
styleSheetPaths: `${__dirname}/public/style/index.scss`,
hacks: [
// window.onerror override
'plugins/canvas/lib/window_error_handler.js',
// Client side plugins go here
'plugins/canvas/lib/load_expression_types.js',
'plugins/canvas/lib/load_transitions.js',
],
mappings,
},
config: Joi => {
return Joi.object({
enabled: Joi.boolean().default(true),
indexPrefix: Joi.string().default('.canvas'),
}).default();
},
init,
});
}