diff --git a/src/core_plugins/kibana/common/tutorials/tutorial_schema.js b/src/core_plugins/kibana/common/tutorials/tutorial_schema.js index b8de6aea1949b..5a95f14b57fdf 100644 --- a/src/core_plugins/kibana/common/tutorials/tutorial_schema.js +++ b/src/core_plugins/kibana/common/tutorials/tutorial_schema.js @@ -91,6 +91,7 @@ export const tutorialSchema = { id: Joi.string().regex(/^[a-zA-Z0-9-]+$/).required(), category: Joi.string().valid(Object.values(TUTORIAL_CATEGORY)).required(), name: Joi.string().required(), + isBeta: Joi.boolean().default(false), shortDescription: Joi.string().required(), euiIconType: Joi.string(), //EUI icon type string, one of https://elastic.github.io/eui/#/icons longDescription: Joi.string().required(), diff --git a/src/core_plugins/kibana/public/home/components/__snapshots__/home.test.js.snap b/src/core_plugins/kibana/public/home/components/__snapshots__/home.test.js.snap index b60ba0d422404..955fa03003d88 100644 --- a/src/core_plugins/kibana/public/home/components/__snapshots__/home.test.js.snap +++ b/src/core_plugins/kibana/public/home/components/__snapshots__/home.test.js.snap @@ -192,6 +192,7 @@ exports[`directories should render ADMIN directory entry in "Manage" panel 1`] = @@ -296,6 +297,7 @@ exports[`directories should render DATA directory entry in "Explore Data" panel diff --git a/src/core_plugins/kibana/public/home/components/__snapshots__/synopsis.test.js.snap b/src/core_plugins/kibana/public/home/components/__snapshots__/synopsis.test.js.snap index e9f04843871ed..795c7c4bc3ac1 100644 --- a/src/core_plugins/kibana/public/home/components/__snapshots__/synopsis.test.js.snap +++ b/src/core_plugins/kibana/public/home/components/__snapshots__/synopsis.test.js.snap @@ -109,6 +109,51 @@ exports[`props iconUrl 1`] = ` `; +exports[`props isBeta 1`] = ` + + + + +

+ Great tutorial +

+
+ +

+ + this is a great tutorial about... + +

+
+
+
+
+`; + exports[`render 1`] = ` + {content} ); @@ -112,4 +112,9 @@ Synopsis.propTypes = { title: PropTypes.string.isRequired, url: PropTypes.string, onClick: PropTypes.func, + isBeta: PropTypes.bool, +}; + +Synopsis.defaultProps = { + isBeta: false }; diff --git a/src/core_plugins/kibana/public/home/components/synopsis.test.js b/src/core_plugins/kibana/public/home/components/synopsis.test.js index 8c491613d09f0..5bea0f3440737 100644 --- a/src/core_plugins/kibana/public/home/components/synopsis.test.js +++ b/src/core_plugins/kibana/public/home/components/synopsis.test.js @@ -51,4 +51,14 @@ describe('props', () => { />); expect(component).toMatchSnapshot(); // eslint-disable-line }); + + test('isBeta', () => { + const component = shallow(); + expect(component).toMatchSnapshot(); // eslint-disable-line + }); }); diff --git a/src/core_plugins/kibana/public/home/components/tutorial/__snapshots__/introduction.test.js.snap b/src/core_plugins/kibana/public/home/components/tutorial/__snapshots__/introduction.test.js.snap index ba2f6756cecaa..d21b9654cb39e 100644 --- a/src/core_plugins/kibana/public/home/components/tutorial/__snapshots__/introduction.test.js.snap +++ b/src/core_plugins/kibana/public/home/components/tutorial/__snapshots__/introduction.test.js.snap @@ -14,16 +14,32 @@ exports[`props exportedFieldsUrl 1`] = ` component="div" grow={true} > - -

- Great tutorial -

-
- + + + +

+ Great tutorial +

+
+
+ @@ -65,10 +81,19 @@ exports[`props iconType 1`] = ` component="div" grow={true} > - -

+ - Great tutorial -

-
- + + +

+ Great tutorial +

+
+
+ + +
+ + +`; + +exports[`props isBeta 1`] = ` + + + + + + +

+ Great tutorial +

+
+
+ + + +
@@ -109,16 +203,32 @@ exports[`props previewUrl 1`] = ` component="div" grow={true} > - -

- Great tutorial -

-
- + + + +

+ Great tutorial +

+
+
+
@@ -153,16 +263,32 @@ exports[`render 1`] = ` component="div" grow={true} > - -

- Great tutorial -

-
- + + + +

+ Great tutorial +

+
+
+ diff --git a/src/core_plugins/kibana/public/home/components/tutorial/__snapshots__/tutorial.test.js.snap b/src/core_plugins/kibana/public/home/components/tutorial/__snapshots__/tutorial.test.js.snap index f415e0d6c3d31..80d6494c65309 100644 --- a/src/core_plugins/kibana/public/home/components/tutorial/__snapshots__/tutorial.test.js.snap +++ b/src/core_plugins/kibana/public/home/components/tutorial/__snapshots__/tutorial.test.js.snap @@ -26,6 +26,7 @@ exports[`isCloudEnabled is false should not render instruction toggle when ON_PR
); } + let betaBadge; + if (isBeta) { + betaBadge = ( + + + + ); + } return ( - -

+ + + {icon} - {title} -

-
- +
+ + +

+ {title} +

+
+
+ {betaBadge} +
+ {exportedFields} + + {img} @@ -96,4 +115,9 @@ Introduction.propTypes = { previewUrl: PropTypes.string, exportedFieldsUrl: PropTypes.string, iconType: PropTypes.string, + isBeta: PropTypes.bool, +}; + +Introduction.defaultProps = { + isBeta: false }; diff --git a/src/core_plugins/kibana/public/home/components/tutorial/introduction.test.js b/src/core_plugins/kibana/public/home/components/tutorial/introduction.test.js index d72f9379f589f..b90a020275225 100644 --- a/src/core_plugins/kibana/public/home/components/tutorial/introduction.test.js +++ b/src/core_plugins/kibana/public/home/components/tutorial/introduction.test.js @@ -57,4 +57,13 @@ describe('props', () => { />); expect(component).toMatchSnapshot(); // eslint-disable-line }); + + test('isBeta', () => { + const component = shallow(); + expect(component).toMatchSnapshot(); // eslint-disable-line + }); }); diff --git a/src/core_plugins/kibana/public/home/components/tutorial/tutorial.js b/src/core_plugins/kibana/public/home/components/tutorial/tutorial.js index 1a737762a7eef..6f64536e61b2a 100644 --- a/src/core_plugins/kibana/public/home/components/tutorial/tutorial.js +++ b/src/core_plugins/kibana/public/home/components/tutorial/tutorial.js @@ -295,6 +295,7 @@ export class Tutorial extends React.Component { previewUrl={previewUrl} exportedFieldsUrl={exportedFieldsUrl} iconType={this.state.tutorial.euiIconType} + isBeta={this.state.tutorial.isBeta} /> diff --git a/src/core_plugins/kibana/public/home/components/tutorial_directory.js b/src/core_plugins/kibana/public/home/components/tutorial_directory.js index 70efecff875be..b2af4f70fe07d 100644 --- a/src/core_plugins/kibana/public/home/components/tutorial_directory.js +++ b/src/core_plugins/kibana/public/home/components/tutorial_directory.js @@ -96,6 +96,7 @@ export class TutorialDirectory extends React.Component { description: tutorialConfig.shortDescription, url: this.props.addBasePath(`#/home/tutorial/${tutorialConfig.id}`), elasticCloud: tutorialConfig.elasticCloud, + isBeta: tutorialConfig.isBeta, }; }); @@ -179,6 +180,7 @@ export class TutorialDirectory extends React.Component { wrapInPanel url={tutorial.url} onClick={tutorial.onClick} + isBeta={tutorial.isBeta} /> );