From 24e79f62db762046c16877c2c982d87e33deffa8 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Fri, 17 Nov 2017 07:56:58 -0800 Subject: [PATCH 1/2] Make commands optional --- .../home/components/tutorial/instruction.js | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/core_plugins/kibana/public/home/components/tutorial/instruction.js b/src/core_plugins/kibana/public/home/components/tutorial/instruction.js index ec034ab3683f7..329b667554e89 100644 --- a/src/core_plugins/kibana/public/home/components/tutorial/instruction.js +++ b/src/core_plugins/kibana/public/home/components/tutorial/instruction.js @@ -19,16 +19,13 @@ export function Instruction({ commands, paramValues, textPost, textPre }) { post = ; } - const aceOptions = { - fontSize: '14px', - maxLines: commands.length - }; - - return ( -
- - {pre} - + let commandsMarkup; + if (commands) { + const aceOptions = { + fontSize: '14px', + maxLines: commands.length + }; + commandsMarkup = (
+ ); + } + return ( +
+ + {pre} + {commandsMarkup} {post}
@@ -47,7 +51,6 @@ export function Instruction({ commands, paramValues, textPost, textPre }) { } Instruction.propTypes = { - commands: PropTypes.array.isRequired, paramValues: PropTypes.object.isRequired, textPost: PropTypes.string, textPre: PropTypes.string, From 2cbb06c319c48f8e766aabb9d0dbdbf093c052da Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Fri, 17 Nov 2017 08:09:10 -0800 Subject: [PATCH 2/2] Adding back prop type for commands, sans isRequired --- .../kibana/public/home/components/tutorial/instruction.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core_plugins/kibana/public/home/components/tutorial/instruction.js b/src/core_plugins/kibana/public/home/components/tutorial/instruction.js index 329b667554e89..4f24b178ecff0 100644 --- a/src/core_plugins/kibana/public/home/components/tutorial/instruction.js +++ b/src/core_plugins/kibana/public/home/components/tutorial/instruction.js @@ -51,6 +51,7 @@ export function Instruction({ commands, paramValues, textPost, textPre }) { } Instruction.propTypes = { + commands: PropTypes.array, paramValues: PropTypes.object.isRequired, textPost: PropTypes.string, textPre: PropTypes.string,