From daf095bc8d7336ee4d18c0f80360811451abc649 Mon Sep 17 00:00:00 2001 From: Tudor Golubenco Date: Wed, 20 Dec 2017 15:15:31 +0100 Subject: [PATCH] Add action button and exported fields to the schema Added to the Joi schema + an example in the apache_logs tutorial. --- .../kibana/common/tutorials/tutorial_schema.js | 15 +++++++++++++++ .../server/tutorials/apache_logs/index.js | 18 +++++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/core_plugins/kibana/common/tutorials/tutorial_schema.js b/src/core_plugins/kibana/common/tutorials/tutorial_schema.js index ac73618468775..2c6a44af614f6 100644 --- a/src/core_plugins/kibana/common/tutorials/tutorial_schema.js +++ b/src/core_plugins/kibana/common/tutorials/tutorial_schema.js @@ -31,6 +31,20 @@ const instructionsSchema = Joi.object({ params: Joi.array().items(paramSchema) }); +const actionButtonSchema = Joi.object({ + url: Joi.string().required(), + linkLabel: Joi.string().required() +}); + +const exportedFieldsSchema = Joi.object({ + documentationUrl: Joi.string().required() +}); + +const artifactsSchema = Joi.object({ + actionButton: actionButtonSchema, + exportedFields: exportedFieldsSchema +}); + export const tutorialSchema = { id: Joi.string().regex(/^[a-zA-Z0-9-]+$/).required(), category: Joi.string().valid(Object.values(TUTORIAL_CATEGORY)).required(), @@ -40,6 +54,7 @@ export const tutorialSchema = { longDescription: Joi.string().required(), completionTimeMinutes: Joi.number().integer(), previewImagePath: Joi.string(), + artifacts: artifactsSchema, // kibana and elastic cluster running on prem onPrem: instructionsSchema.required(), diff --git a/src/core_plugins/kibana/server/tutorials/apache_logs/index.js b/src/core_plugins/kibana/server/tutorials/apache_logs/index.js index b08edd72b8e41..3f0ab00a7066c 100644 --- a/src/core_plugins/kibana/server/tutorials/apache_logs/index.js +++ b/src/core_plugins/kibana/server/tutorials/apache_logs/index.js @@ -13,15 +13,15 @@ export function apacheLogsSpecProvider() { ' [Learn more]({config.docs.beats.filebeat}/filebeat-module-apache2.html)' + ' about the apache2 module.', //iconPath: '', TODO - /*artifacts: { - dashboards: [ - { - id: 'Filebeat-Apache2-Dashboard', - linkLabel: 'Apache2 logs dashboard', - isOverview: true - } - ] - },*/ + artifacts: { + actionButton: { + url: '#/dashboard/Filebeat-Apache2-Dashboard', + linkLabel: 'Go to the Apache2 dashboard' + }, + exportedFields: { + documentationUrl: '{config.docs.beats.filebeat}/exported-fields-apache2.html' + } + }, completionTimeMinutes: 10, previewImagePath: '/plugins/kibana/home/tutorial_resources/apacheLogs/kibana-apache2.png', onPrem: ON_PREM_INSTRUCTIONS,