Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action button and exported fields to the schema #17

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/core_plugins/kibana/common/tutorials/tutorial_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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(),
Expand Down
18 changes: 9 additions & 9 deletions src/core_plugins/kibana/server/tutorials/apache_logs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern here is that Kibana might internally change their URL structure and then all the tutorials that specify such URLs might need to be updated. What do you think about leaving the dashboards section as-is but also including a more-generic actionButton section?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we already rely on relative URLs in the Beats and Logstash dashboards (when they cross-link each other).

I agree to keep the dashboards section. This wasn't meant to replace it, since at some point it's going to be useful for Kibana to know which dashboards are added by which module. But the button from the bottom should be based on the actionButton section, right?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the actionButton can be optional and used to override the default behavior of linking to the target dashboard?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works for me. Perhaps it's best if you adjust the Joi schema as you implement the feature?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good. Are you going to add the artifact stuff or should I.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do it please? I’m just about to start my traveling, so I won’t be able to do it too soon.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. Have a great vacation.

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,
Expand Down