From 4382081b5f68bf2b6005cd424255f308179f1bb5 Mon Sep 17 00:00:00 2001 From: Jason Rhodes Date: Thu, 23 Jan 2020 11:52:40 -0500 Subject: [PATCH] Initiates legacy plugin correctly with proper dummy config --- x-pack/index.js | 2 ++ x-pack/legacy/plugins/infra/index.ts | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/x-pack/index.js b/x-pack/index.js index 55fbdefb60f66..83a7b5540334f 100644 --- a/x-pack/index.js +++ b/x-pack/index.js @@ -26,6 +26,7 @@ import { consoleExtensions } from './legacy/plugins/console_extensions'; import { spaces } from './legacy/plugins/spaces'; import { kueryAutocompleteInitializer } from './legacy/plugins/kuery_autocomplete'; import { canvas } from './legacy/plugins/canvas'; +import { infra } from './legacy/plugins/infra'; import { taskManager } from './legacy/plugins/task_manager'; import { rollup } from './legacy/plugins/rollup'; import { siem } from './legacy/plugins/siem'; @@ -67,6 +68,7 @@ module.exports = function(kibana) { consoleExtensions(kibana), indexLifecycleManagement(kibana), kueryAutocompleteInitializer(kibana), + infra(kibana), taskManager(kibana), rollup(kibana), transform(kibana), diff --git a/x-pack/legacy/plugins/infra/index.ts b/x-pack/legacy/plugins/infra/index.ts index e348b6d644455..6ef273924a346 100644 --- a/x-pack/legacy/plugins/infra/index.ts +++ b/x-pack/legacy/plugins/infra/index.ts @@ -3,18 +3,23 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ - +import { Root } from 'joi'; import { savedObjectMappings } from '../../../plugins/infra/server'; -export const APP_ID = 'infra'; - export function infra(kibana: any) { return new kibana.Plugin({ - id: APP_ID, + id: 'infra', configPrefix: 'xpack.infra', require: ['kibana', 'elasticsearch'], uiExports: { mappings: savedObjectMappings, }, + config(Joi: Root) { + return Joi.object({ + enabled: Joi.boolean().default(true), + }) + .unknown() + .default(); + }, }); }