diff --git a/x-pack/plugins/security_solution/public/app/components/onboarding/onboarding_page_service.ts b/x-pack/plugins/security_solution/public/app/components/onboarding/onboarding_page_service.ts index ea5beab4608d2..16448b92d3a4f 100644 --- a/x-pack/plugins/security_solution/public/app/components/onboarding/onboarding_page_service.ts +++ b/x-pack/plugins/security_solution/public/app/components/onboarding/onboarding_page_service.ts @@ -13,22 +13,26 @@ import type { StepId } from '../../../common/components/landing_page/onboarding/ export class OnboardingPageService { private productTypesSubject$: BehaviorSubject; private projectsUrlSubject$: BehaviorSubject; + private usersUrlSubject$: BehaviorSubject; private projectFeaturesUrlSubject$: BehaviorSubject; private availableStepsSubject$: BehaviorSubject; public productTypes$: Observable; public projectsUrl$: Observable; + public usersUrl$: Observable; public projectFeaturesUrl$: Observable; public availableSteps$: Observable; constructor() { this.productTypesSubject$ = new BehaviorSubject(undefined); this.projectsUrlSubject$ = new BehaviorSubject(undefined); + this.usersUrlSubject$ = new BehaviorSubject(undefined); this.projectFeaturesUrlSubject$ = new BehaviorSubject(undefined); this.availableStepsSubject$ = new BehaviorSubject([]); this.productTypes$ = this.productTypesSubject$.asObservable(); this.projectsUrl$ = this.projectsUrlSubject$.asObservable(); + this.usersUrl$ = this.usersUrlSubject$.asObservable(); this.projectFeaturesUrl$ = this.projectFeaturesUrlSubject$.asObservable(); this.availableSteps$ = this.availableStepsSubject$.asObservable(); } @@ -39,6 +43,9 @@ export class OnboardingPageService { setProjectFeaturesUrl(projectFeaturesUrl: string | undefined) { this.projectFeaturesUrlSubject$.next(projectFeaturesUrl); } + setUsersUrl(userUrl: string | undefined) { + this.usersUrlSubject$.next(userUrl); + } setProjectsUrl(projectsUrl: string | undefined) { this.projectsUrlSubject$.next(projectsUrl); } diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_item.test.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_item.test.tsx index 91417dc8e3ddf..c0730847c5e43 100644 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_item.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_item.test.tsx @@ -9,7 +9,7 @@ import { render } from '@testing-library/react'; import { CardItem } from './card_item'; import type { ExpandedCardSteps, StepId } from './types'; -import { QuickStartSectionCardsId, SectionId, OverviewSteps } from './types'; +import { SectionId, ViewDashboardSteps, AddAndValidateYourDataCardsId } from './types'; jest.mock('./card_step'); describe('CardItemComponent', () => { @@ -17,7 +17,7 @@ describe('CardItemComponent', () => { const onStepClicked = jest.fn(); const toggleTaskCompleteStatus = jest.fn(); const expandedCardSteps = { - [QuickStartSectionCardsId.watchTheOverviewVideo]: { + [AddAndValidateYourDataCardsId.viewDashboards]: { isExpanded: false, expandedSteps: [] as StepId[], }, @@ -26,17 +26,17 @@ describe('CardItemComponent', () => { it('should render card', () => { const { getByTestId } = render( ); - const cardTitle = getByTestId(QuickStartSectionCardsId.watchTheOverviewVideo); + const cardTitle = getByTestId(AddAndValidateYourDataCardsId.viewDashboards); expect(cardTitle).toBeInTheDocument(); }); @@ -44,12 +44,12 @@ describe('CardItemComponent', () => { const { queryByText } = render( ); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/data_ingestion_hub_video.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/data_ingestion_hub_video.tsx new file mode 100644 index 0000000000000..181d4a797ebbc --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/data_ingestion_hub_video.tsx @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem, EuiIcon, useEuiTheme } from '@elastic/eui'; +import { css } from '@emotion/react'; +import React, { useCallback } from 'react'; +import { INGESTION_HUB_VIDEO_SOURCE } from '../../../../../constants'; +import { WATCH_VIDEO_BUTTON_TITLE } from '../../translations'; + +const VIDEO_CONTENT_HEIGHT = 309; + +const DataIngestionHubVideoComponent: React.FC = () => { + const ref = React.useRef(null); + const [isVideoPlaying, setIsVideoPlaying] = React.useState(false); + const { euiTheme } = useEuiTheme(); + + const onVideoClicked = useCallback(() => { + setIsVideoPlaying(true); + }, []); + + return ( +
+
+ {isVideoPlaying && ( + + + + + + )} + {!isVideoPlaying && ( +