diff --git a/src/plugins/home/common/constants.ts b/src/plugins/home/common/constants.ts index d80988c000c0f..c44e5b8e95789 100644 --- a/src/plugins/home/common/constants.ts +++ b/src/plugins/home/common/constants.ts @@ -8,3 +8,10 @@ export const PLUGIN_ID = 'home'; export const HOME_APP_BASE_PATH = `/app/${PLUGIN_ID}`; + +export enum TutorialsCategory { + LOGGING = 'logging', + SECURITY_SOLUTION = 'security', + METRICS = 'metrics', + OTHER = 'other', +} diff --git a/src/plugins/home/public/application/components/tutorial/__snapshots__/introduction.test.js.snap b/src/plugins/home/public/application/components/tutorial/__snapshots__/introduction.test.js.snap index 247f43df76d3b..1243693fe4853 100644 --- a/src/plugins/home/public/application/components/tutorial/__snapshots__/introduction.test.js.snap +++ b/src/plugins/home/public/application/components/tutorial/__snapshots__/introduction.test.js.snap @@ -1,5 +1,93 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`props Beats badge should not show 1`] = ` + +
+ + + +
+ + + + + } + pageTitle={ + + Great tutorial + +   + + + + } + /> +
+`; + +exports[`props Beats badge should show 1`] = ` + +
+ + + +
+ + + + + } + pageTitle={ + + Great tutorial + +   + + + +   + + + + + + } + /> +
+`; + exports[`props exportedFieldsUrl 1`] = `
diff --git a/src/plugins/home/public/application/components/tutorial/introduction.js b/src/plugins/home/public/application/components/tutorial/introduction.js index 59c1454579e23..fbd1eaabb3efe 100644 --- a/src/plugins/home/public/application/components/tutorial/introduction.js +++ b/src/plugins/home/public/application/components/tutorial/introduction.js @@ -16,9 +16,11 @@ import { EuiPageHeader, EuiButtonEmpty, EuiSpacer, + EuiBadge, } from '@elastic/eui'; import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; +import { TutorialsCategory } from '../../../../common/constants'; function IntroductionUI({ description, @@ -30,6 +32,7 @@ function IntroductionUI({ intl, notices, basePath, + category, }) { let rightSideItems; if (previewUrl) { @@ -98,6 +101,18 @@ function IntroductionUI({ {betaBadge} )} + + {category === TutorialsCategory.LOGGING || category === TutorialsCategory.METRICS ? ( + <> +   + + + + + ) : null} } description={ diff --git a/src/plugins/home/public/application/components/tutorial/introduction.test.js b/src/plugins/home/public/application/components/tutorial/introduction.test.js index 49293fa13b015..70b4856a8b2fd 100644 --- a/src/plugins/home/public/application/components/tutorial/introduction.test.js +++ b/src/plugins/home/public/application/components/tutorial/introduction.test.js @@ -11,6 +11,7 @@ import { shallowWithIntl } from '@kbn/test/jest'; import { Introduction } from './introduction'; import { httpServiceMock } from '../../../../../../core/public/mocks'; +import { TutorialsCategory } from '../../../../common/constants'; const basePathMock = httpServiceMock.createBasePath(); @@ -73,4 +74,30 @@ describe('props', () => { ); expect(component).toMatchSnapshot(); // eslint-disable-line }); + + test('Beats badge should show', () => { + const component = shallowWithIntl( + + ); + expect(component).toMatchSnapshot(); + }); + + test('Beats badge should not show', () => { + const component = shallowWithIntl( + + ); + expect(component).toMatchSnapshot(); + }); }); diff --git a/src/plugins/home/public/application/components/tutorial/tutorial.js b/src/plugins/home/public/application/components/tutorial/tutorial.js index 14043338a9429..00cbf013856da 100644 --- a/src/plugins/home/public/application/components/tutorial/tutorial.js +++ b/src/plugins/home/public/application/components/tutorial/tutorial.js @@ -414,6 +414,7 @@ class TutorialUi extends React.Component { content = (
- - - {/* Render space in place of package name while package info loads to prevent layout from jumping around */} -

{integrationInfo?.title || packageInfo?.title || '\u00A0'}

-
+ + + + + {/* Render space in place of package name while package info loads to prevent layout from jumping around */} +

{integrationInfo?.title || packageInfo?.title || '\u00A0'}

+
+
+ + + {i18n.translate('xpack.fleet.epm.elasticAgentBadgeLabel', { + defaultMessage: 'Elastic Agent', + })} + + +
{packageInfo?.release && packageInfo.release !== 'ga' ? (