Skip to content

Commit

Permalink
add artifacts to tutorial schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Dec 21, 2017
1 parent a38dd51 commit 45fa827
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/core_plugins/kibana/common/tutorials/tutorial_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@ import Joi from 'joi';
import { PARAM_TYPES } from './param_types';
import { TUTORIAL_CATEGORY } from './tutorial_category';

const dashboardSchema = Joi.object({
title: Joi.string().required(),
linkLabel: Joi.string().when('isOverview', {
is: true,
then: Joi.required(),
}),
// Is this an Overview / Entry Point dashboard?
isOverview: Joi.boolean().required()
});

const artifactsSchema = Joi.object({
// Fields present in Elasticsearch documents created by this product.
exportedFields: Joi.object({
documentationUrl: Joi.string()
}),
// Kibana dashboards created by this product.
dashboards: Joi.array().items(dashboardSchema).required()
});

const instructionSchema = Joi.object({
title: Joi.string(),
textPre: Joi.string(),
Expand All @@ -16,6 +35,7 @@ const instructionVariantSchema = Joi.object({

const instructionSetSchema = Joi.object({
title: Joi.string(),
// Variants (OSes, languages, etc.) for which tutorial instructions are specified.
instructionVariants: Joi.array().items(instructionVariantSchema).required()
});

Expand Down Expand Up @@ -48,5 +68,8 @@ export const tutorialSchema = {
elasticCloud: instructionsSchema.required(),

// kibana running on prem and elastic cluster running in elastic's cloud
onPremElasticCloud: instructionsSchema.required()
onPremElasticCloud: instructionsSchema.required(),

// Elastic stack artifacts produced by product when it is setup and run.
artifacts: artifactsSchema,
};

0 comments on commit 45fa827

Please sign in to comment.