diff --git a/packages/kbn-guided-onboarding/src/components/landing_page/__snapshots__/guide_cards.test.tsx.snap b/packages/kbn-guided-onboarding/src/components/landing_page/__snapshots__/guide_cards.test.tsx.snap index 55fa0c49d49a1a8..dd633872933f44c 100644 --- a/packages/kbn-guided-onboarding/src/components/landing_page/__snapshots__/guide_cards.test.tsx.snap +++ b/packages/kbn-guided-onboarding/src/components/landing_page/__snapshots__/guide_cards.test.tsx.snap @@ -3,7 +3,7 @@ exports[`guide cards snapshots should render all cards 1`] = ` , + } + } + />, } } guidesState={Array []} @@ -68,7 +76,15 @@ exports[`guide cards snapshots should render all cards 1`] = ` "order": 3, "solution": "security", "telemetryId": "onboarding--security--siem", - "title": "Detect threats in my data with SIEM", + "title": , + } + } + />, } } guidesState={Array []} @@ -117,7 +133,15 @@ exports[`guide cards snapshots should render all cards 1`] = ` "order": 5, "solution": "observability", "telemetryId": "onboarding--observability--apm", - "title": "Monitor my application performance (APM / tracing)", + "title": , + } + } + />, } } guidesState={Array []} @@ -143,7 +167,15 @@ exports[`guide cards snapshots should render all cards 1`] = ` "order": 6, "solution": "security", "telemetryId": "onboarding--security--hosts", - "title": "Secure my hosts with endpoint security", + "title": , + } + } + />, } } guidesState={Array []} @@ -166,7 +198,15 @@ exports[`guide cards snapshots should render all cards 1`] = ` "order": 7, "solution": "search", "telemetryId": "onboarding--search--database", - "title": "Search across databases and business systems", + "title": , + } + } + />, } } guidesState={Array []} @@ -218,7 +258,15 @@ exports[`guide cards snapshots should render all cards 1`] = ` "order": 9, "solution": "security", "telemetryId": "onboarding--security--cloud", - "title": "Secure my cloud assets with posture management", + "title": , + } + } + />, } } guidesState={Array []} diff --git a/packages/kbn-guided-onboarding/src/components/landing_page/guide_card.tsx b/packages/kbn-guided-onboarding/src/components/landing_page/guide_card.tsx index ca0891a0f28082d..559af288c5575c0 100644 --- a/packages/kbn-guided-onboarding/src/components/landing_page/guide_card.tsx +++ b/packages/kbn-guided-onboarding/src/components/landing_page/guide_card.tsx @@ -9,7 +9,15 @@ import React, { useCallback, useState } from 'react'; import { css } from '@emotion/react'; -import { EuiCard, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSpacer, EuiTextColor } from '@elastic/eui'; +import { + EuiCard, + EuiFlexGroup, + EuiFlexItem, + EuiIcon, + EuiSpacer, + EuiTextColor, + useEuiTheme, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { GuideState } from '../../types'; @@ -55,6 +63,7 @@ export const GuideCard = ({ activeFilter, }: GuideCardsProps & { card: GuideCardConstants }) => { const [isLoading, setIsLoading] = useState(false); + const { euiTheme } = useEuiTheme(); let guideState: GuideState | undefined; if (card.guideId) { guideState = guidesState.find((state) => state.guideId === card.guideId); @@ -102,9 +111,9 @@ export const GuideCard = ({ )} {isComplete && ( - + - + @@ -115,6 +124,7 @@ export const GuideCard = ({ )} + {card.navigateTo && } } /> diff --git a/packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.constants.ts b/packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.constants.tsx similarity index 66% rename from packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.constants.ts rename to packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.constants.tsx index a74f80114a21677..5603072b3447b57 100644 --- a/packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.constants.ts +++ b/packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.constants.tsx @@ -7,12 +7,14 @@ */ import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import React, { ReactNode } from 'react'; import { GuideId } from '../../..'; import { GuideCardSolutions } from './guide_cards'; export interface GuideCardConstants { solution: GuideCardSolutions; - title: string; + title: string | ReactNode; // if present, guideId indicates which guide is opened when clicking the card guideId?: GuideId; // if present, navigateTo indicates where the user will be redirected, when clicking the card @@ -30,9 +32,15 @@ export interface GuideCardConstants { export const guideCards: GuideCardConstants[] = [ { solution: 'search', - title: i18n.translate('guidedOnboardingPackage.gettingStarted.cards.appSearch.title', { - defaultMessage: 'Build an application on top of Elasticsearch', - }), + title: ( + , + }} + /> + ), guideId: 'appSearch', telemetryId: 'onboarding--search--application', order: 1, @@ -48,9 +56,15 @@ export const guideCards: GuideCardConstants[] = [ }, { solution: 'search', - title: i18n.translate('guidedOnboardingPackage.gettingStarted.cards.databaseSearch.title', { - defaultMessage: 'Search across databases and business systems', - }), + title: ( + , + }} + /> + ), guideId: 'databaseSearch', telemetryId: 'onboarding--search--database', order: 7, @@ -69,9 +83,15 @@ export const guideCards: GuideCardConstants[] = [ }, { solution: 'observability', - title: i18n.translate('guidedOnboardingPackage.gettingStarted.cards.apmObservability.title', { - defaultMessage: 'Monitor my application performance (APM / tracing)', - }), + title: ( + , + }} + /> + ), navigateTo: { appId: 'home', path: '#/tutorial/apm', @@ -105,18 +125,30 @@ export const guideCards: GuideCardConstants[] = [ }, { solution: 'security', - title: i18n.translate('guidedOnboardingPackage.gettingStarted.cards.siemSecurity.title', { - defaultMessage: 'Detect threats in my data with SIEM', - }), + title: ( + , + }} + /> + ), guideId: 'siem', telemetryId: 'onboarding--security--siem', order: 3, }, { solution: 'security', - title: i18n.translate('guidedOnboardingPackage.gettingStarted.cards.hostsSecurity.title', { - defaultMessage: 'Secure my hosts with endpoint security', - }), + title: ( + , + }} + /> + ), navigateTo: { appId: 'integrations', path: '/detail/endpoint/overview', @@ -126,9 +158,15 @@ export const guideCards: GuideCardConstants[] = [ }, { solution: 'security', - title: i18n.translate('guidedOnboardingPackage.gettingStarted.cards.cloudSecurity.title', { - defaultMessage: 'Secure my cloud assets with posture management', - }), + title: ( + , + }} + /> + ), navigateTo: { appId: 'integrations', path: '/detail/cloud_security_posture/overview', diff --git a/packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.tsx b/packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.tsx index 45d32d8089ef3cb..1f3269c59650346 100644 --- a/packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.tsx +++ b/packages/kbn-guided-onboarding/src/components/landing_page/guide_cards.tsx @@ -27,7 +27,7 @@ export interface GuideCardsProps { } export const GuideCards = (props: GuideCardsProps) => { return ( - + {guideCards.map((card, index) => (