diff --git a/x-pack/plugins/security_solution/common/constants.ts b/x-pack/plugins/security_solution/common/constants.ts index f947369112033..35f2b8ae177c0 100644 --- a/x-pack/plugins/security_solution/common/constants.ts +++ b/x-pack/plugins/security_solution/common/constants.ts @@ -27,8 +27,9 @@ export const APP_NAME = 'Security' as const; export const APP_ICON = 'securityAnalyticsApp' as const; export const APP_ICON_SOLUTION = 'logoSecurity' as const; export const APP_PATH = `/app/security` as const; -export const ADD_DATA_PATH = `/app/integrations/browse/security`; -export const ADD_THREAT_INTELLIGENCE_DATA_PATH = `/app/integrations/browse/threat_intel`; +export const APP_INTEGRATIONS_PATH = `/app/integrations` as const; +export const ADD_DATA_PATH = `${APP_INTEGRATIONS_PATH}/browse/security`; +export const ADD_THREAT_INTELLIGENCE_DATA_PATH = `${APP_INTEGRATIONS_PATH}/browse/threat_intel`; export const DEFAULT_BYTES_FORMAT = 'format:bytes:defaultPattern' as const; export const DEFAULT_DATE_FORMAT = 'dateFormat' as const; export const DEFAULT_DATE_FORMAT_TZ = 'dateFormat:tz' as const; @@ -85,7 +86,7 @@ export const MANAGE_PATH = '/manage' as const; export const TIMELINES_PATH = '/timelines' as const; export const CASES_PATH = '/cases' as const; export const OVERVIEW_PATH = '/overview' as const; -export const LANDING_PATH = '/get_started' as const; +export const ONBOARDING_PATH = '/get_started' as const; export const DATA_QUALITY_PATH = '/data_quality' as const; export const DETECTION_RESPONSE_PATH = '/detection_response' as const; export const DETECTIONS_PATH = '/detections' as const; diff --git a/x-pack/plugins/security_solution/public/app/app_routes.tsx b/x-pack/plugins/security_solution/public/app/app_routes.tsx index 07a17b4f0f00b..4b3913bfb4d3c 100644 --- a/x-pack/plugins/security_solution/public/app/app_routes.tsx +++ b/x-pack/plugins/security_solution/public/app/app_routes.tsx @@ -10,7 +10,12 @@ import type { RouteProps } from 'react-router-dom'; import { Redirect } from 'react-router-dom'; import { Routes, Route } from '@kbn/shared-ux-router'; import type { Capabilities } from '@kbn/core/public'; -import { CASES_FEATURE_ID, CASES_PATH, LANDING_PATH, SERVER_APP_ID } from '../../common/constants'; +import { + CASES_FEATURE_ID, + CASES_PATH, + ONBOARDING_PATH, + SERVER_APP_ID, +} from '../../common/constants'; import { NotFoundPage } from './404'; import type { StartServices } from '../types'; @@ -33,7 +38,7 @@ AppRoutes.displayName = 'AppRoutes'; export const RedirectRoute = React.memo<{ capabilities: Capabilities }>(({ capabilities }) => { if (capabilities[SERVER_APP_ID].show === true) { - return ; + return ; } if (capabilities[CASES_FEATURE_ID].read_cases === true) { return ; 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 deleted file mode 100644 index 16448b92d3a4f..0000000000000 --- a/x-pack/plugins/security_solution/public/app/components/onboarding/onboarding_page_service.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 type { Observable } from 'rxjs'; -import { BehaviorSubject } from 'rxjs'; -import type { SecurityProductTypes } from '../../../common/components/landing_page/onboarding/configs'; -import type { StepId } from '../../../common/components/landing_page/onboarding/types'; - -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(); - } - - setProductTypes(productTypes: SecurityProductTypes) { - this.productTypesSubject$.next(productTypes); - } - setProjectFeaturesUrl(projectFeaturesUrl: string | undefined) { - this.projectFeaturesUrlSubject$.next(projectFeaturesUrl); - } - setUsersUrl(userUrl: string | undefined) { - this.usersUrlSubject$.next(userUrl); - } - setProjectsUrl(projectsUrl: string | undefined) { - this.projectsUrlSubject$.next(projectsUrl); - } - setAvailableSteps(availableSteps: StepId[]) { - this.availableStepsSubject$.next(availableSteps); - } -} diff --git a/x-pack/plugins/security_solution/public/app_links.ts b/x-pack/plugins/security_solution/public/app_links.ts index 334209b744580..481b58949ed24 100644 --- a/x-pack/plugins/security_solution/public/app_links.ts +++ b/x-pack/plugins/security_solution/public/app_links.ts @@ -16,7 +16,7 @@ import { links as timelinesLinks } from './timelines/links'; import { links as casesLinks } from './cases/links'; import { links as managementLinks, getManagementFilteredLinks } from './management/links'; import { exploreLinks } from './explore/links'; -import { gettingStartedLinks } from './overview/links'; +import { onboardingLinks } from './onboarding/links'; import { findingsLinks } from './cloud_security_posture/links'; import type { StartPlugins } from './types'; import { dashboardsLinks } from './dashboards/links'; @@ -34,7 +34,7 @@ export const appLinks: AppLinkItems = Object.freeze([ indicatorsLinks, exploreLinks, rulesLinks, - gettingStartedLinks, + onboardingLinks, managementLinks, notesLink, ]); @@ -55,7 +55,7 @@ export const getFilteredLinks = async ( indicatorsLinks, exploreLinks, rulesLinks, - gettingStartedLinks, + onboardingLinks, managementFilteredLinks, notesLink, ]); diff --git a/x-pack/plugins/security_solution/public/common/components/centered_loading_spinner/centered_loading_spinner.tsx b/x-pack/plugins/security_solution/public/common/components/centered_loading_spinner/centered_loading_spinner.tsx new file mode 100644 index 0000000000000..9e12d785bf32a --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/centered_loading_spinner/centered_loading_spinner.tsx @@ -0,0 +1,30 @@ +/* + * 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 React, { useMemo } from 'react'; +import { EuiLoadingSpinner, useEuiTheme, type EuiLoadingSpinnerProps } from '@elastic/eui'; + +interface CenteredLoadingSpinnerProps extends EuiLoadingSpinnerProps { + topOffset?: string; +} + +export const CenteredLoadingSpinner = React.memo( + ({ topOffset, ...euiLoadingSpinnerProps }) => { + const { euiTheme } = useEuiTheme(); + const style = useMemo( + () => ({ + display: 'flex', + margin: `${euiTheme.size.xl} auto`, + ...(topOffset && { marginTop: topOffset }), + }), + [topOffset, euiTheme] + ); + + return ; + } +); +CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner'; diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/__mocks__/use_project_features_url.ts b/x-pack/plugins/security_solution/public/common/components/centered_loading_spinner/index.ts similarity index 77% rename from x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/__mocks__/use_project_features_url.ts rename to x-pack/plugins/security_solution/public/common/components/centered_loading_spinner/index.ts index dc08286e35d25..2d263a0773cc7 100644 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/hooks/__mocks__/use_project_features_url.ts +++ b/x-pack/plugins/security_solution/public/common/components/centered_loading_spinner/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export const useProjectFeaturesUrl = jest.fn(() => 'mocked_user_name'); +export { CenteredLoadingSpinner } from './centered_loading_spinner'; diff --git a/x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.test.tsx b/x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.test.tsx index c64d61d2bd226..d3982d005ba89 100644 --- a/x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.test.tsx @@ -10,7 +10,7 @@ import { fireEvent, render } from '@testing-library/react'; import { EmptyPromptComponent } from './empty_prompt'; import { SecurityPageName } from '../../../../common'; import { useNavigateTo } from '../../lib/kibana'; -import { AddIntegrationsSteps } from '../landing_page/onboarding/types'; +import { OnboardingCardId } from '../../../onboarding/constants'; const mockNavigateTo = jest.fn(); const mockUseNavigateTo = useNavigateTo as jest.Mock; @@ -37,7 +37,7 @@ describe('EmptyPromptComponent component', () => { fireEvent.click(link); expect(mockNavigateTo).toBeCalledWith({ deepLinkId: SecurityPageName.landing, - path: `#${AddIntegrationsSteps.connectToDataSources}`, + path: `#${OnboardingCardId.integrations}`, }); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.tsx b/x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.tsx index 6b36f64d27ea4..4cf9bcbb4d774 100644 --- a/x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.tsx +++ b/x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.tsx @@ -16,6 +16,7 @@ import { type EuiThemeComputed, } from '@elastic/eui'; import { css } from '@emotion/react'; +import { OnboardingCardId } from '../../../onboarding/constants'; import { SecurityPageName } from '../../../../common'; import * as i18n from './translations'; @@ -23,8 +24,7 @@ import endpointSvg from './images/endpoint1.svg'; import cloudSvg from './images/cloud1.svg'; import siemSvg from './images/siem1.svg'; import { useNavigateTo } from '../../lib/kibana'; -import { VIDEO_SOURCE } from './constants'; -import { AddIntegrationsSteps } from '../landing_page/onboarding/types'; +import { ONBOARDING_VIDEO_SOURCE } from '../../constants'; const imgUrls = { cloud: cloudSvg, @@ -75,7 +75,7 @@ export const EmptyPromptComponent = memo(() => { const navigateToAddIntegrations = useCallback(() => { navigateTo({ deepLinkId: SecurityPageName.landing, - path: `#${AddIntegrationsSteps.connectToDataSources}`, + path: `#${OnboardingCardId.integrations}`, }); }, [navigateTo]); @@ -115,7 +115,7 @@ export const EmptyPromptComponent = memo(() => { referrerPolicy="no-referrer" sandbox="allow-scripts allow-same-origin" scrolling="no" - src={VIDEO_SOURCE} + src={ONBOARDING_VIDEO_SOURCE} title={i18n.SIEM_HEADER} width="100%" /> diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/index.test.tsx deleted file mode 100644 index 25097cddbd1cc..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/index.test.tsx +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 React from 'react'; -import { render } from '@testing-library/react'; -import { LandingPageComponent } from '.'; - -jest.mock('../../../sourcerer/containers', () => ({ - useSourcererDataView: jest.fn().mockReturnValue({ indicesExist: false }), -})); -jest.mock('./onboarding'); - -describe('LandingPageComponent', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('renders the onboarding component', () => { - const { queryByTestId } = render(); - - expect(queryByTestId('onboarding-with-settings')).toBeInTheDocument(); - }); -}); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/index.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/index.tsx deleted file mode 100644 index 669b7497a8403..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/index.tsx +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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 React, { memo } from 'react'; -import { useSourcererDataView } from '../../../sourcerer/containers'; -import { Onboarding } from './onboarding'; - -export const LandingPageComponent = memo(() => { - const { indicesExist } = useSourcererDataView(); - return ; -}); - -LandingPageComponent.displayName = 'LandingPageComponent'; diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/__mocks__/product_switch.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/__mocks__/product_switch.tsx deleted file mode 100644 index 8b98ffe3cf6ea..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/__mocks__/product_switch.tsx +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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 type { PropsWithChildren } from 'react'; -import React from 'react'; - -export const ProductSwitch = jest - .fn() - .mockImplementation(({ children }: PropsWithChildren) => ( -
{children}
- )); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/__mocks__/storage.ts b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/__mocks__/storage.ts deleted file mode 100644 index e02a83572a17f..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/__mocks__/storage.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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. - */ - -export const mockGetAllFinishedStepsFromStorage = jest.fn(() => ({})); -export const mockGetFinishedStepsFromStorageByCardId = jest.fn(() => []); -export const mockGetActiveProductsFromStorage = jest.fn(() => []); -export const mockToggleActiveProductsInStorage = jest.fn(); -export const mockResetAllExpandedCardStepsToStorage = jest.fn(); -export const mockAddFinishedStepToStorage = jest.fn(); -export const mockRemoveFinishedStepFromStorage = jest.fn(); -export const mockAddExpandedCardStepToStorage = jest.fn(); -export const mockRemoveExpandedCardStepFromStorage = jest.fn(); -export const mockGetAllExpandedCardStepsFromStorage = jest.fn(() => ({})); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/__mocks__/toggle_panel.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/__mocks__/toggle_panel.tsx deleted file mode 100644 index e297e119dfffe..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/__mocks__/toggle_panel.tsx +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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 type { PropsWithChildren } from 'react'; -import React from 'react'; - -export const TogglePanel = jest - .fn() - .mockImplementation(({ children }: PropsWithChildren) => ( -
{children}
- )); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/badge.ts b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/badge.ts deleted file mode 100644 index 2cd0e0a20a7f8..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/badge.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 { ProductLine } from './configs'; -import { PRODUCT_BADGE_ANALYTICS, PRODUCT_BADGE_CLOUD, PRODUCT_BADGE_EDR } from './translations'; -import type { Badge } from './types'; -import { BadgeId } from './types'; - -export const analyticsBadge: Badge = { - id: BadgeId.analytics, - name: PRODUCT_BADGE_ANALYTICS, -}; - -export const cloudBadge: Badge = { - id: BadgeId.cloud, - name: PRODUCT_BADGE_CLOUD, -}; - -export const edrBadge: Badge = { - id: BadgeId.edr, - name: PRODUCT_BADGE_EDR, -}; - -const productBadges: Record = { - [ProductLine.security]: analyticsBadge, - [ProductLine.cloud]: cloudBadge, - [ProductLine.endpoint]: edrBadge, -}; - -export const getProductBadges = (productLineRequired?: ProductLine[] | undefined): Badge[] => - (productLineRequired ?? [ProductLine.security, ProductLine.cloud, ProductLine.endpoint]).map( - (product) => productBadges[product] - ); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/badges.test.ts b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/badges.test.ts deleted file mode 100644 index 6921389d67149..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/badges.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 { analyticsBadge, cloudBadge, edrBadge, getProductBadges } from './badge'; -import { ProductLine } from './configs'; - -describe('getProductBadges', () => { - test('should return all badges if no productLineRequired is passed', () => { - expect(getProductBadges()).toEqual([analyticsBadge, cloudBadge, edrBadge]); - }); - - test('should return only the badges for the productLineRequired passed', () => { - expect(getProductBadges([ProductLine.cloud])).toEqual([cloudBadge]); - }); -}); 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 deleted file mode 100644 index c0730847c5e43..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_item.test.tsx +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 React from 'react'; -import { render } from '@testing-library/react'; -import { CardItem } from './card_item'; -import type { ExpandedCardSteps, StepId } from './types'; - -import { SectionId, ViewDashboardSteps, AddAndValidateYourDataCardsId } from './types'; -jest.mock('./card_step'); - -describe('CardItemComponent', () => { - const finishedSteps = new Set([]) as Set; - const onStepClicked = jest.fn(); - const toggleTaskCompleteStatus = jest.fn(); - const expandedCardSteps = { - [AddAndValidateYourDataCardsId.viewDashboards]: { - isExpanded: false, - expandedSteps: [] as StepId[], - }, - } as ExpandedCardSteps; - - it('should render card', () => { - const { getByTestId } = render( - - ); - - const cardTitle = getByTestId(AddAndValidateYourDataCardsId.viewDashboards); - expect(cardTitle).toBeInTheDocument(); - }); - - it('should not render card when no active steps', () => { - const { queryByText } = render( - - ); - - const cardTitle = queryByText('Introduction'); - expect(cardTitle).not.toBeInTheDocument(); - }); -}); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_item.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_item.tsx deleted file mode 100644 index e7dbdfd4e318a..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_item.tsx +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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, EuiPanel } from '@elastic/eui'; - -import React, { useMemo, useCallback } from 'react'; - -import classnames from 'classnames'; -import type { - CardId, - ExpandedCardSteps, - ToggleTaskCompleteStatus, - OnStepClicked, - SectionId, - StepId, -} from './types'; -import { getCard } from './helpers'; -import { CardStep } from './card_step'; -import { useCardItemStyles } from './styles/card_item.styles'; - -export const SHADOW_ANIMATION_DURATION = 350; - -const CardItemComponent: React.FC<{ - activeStepIds: StepId[] | undefined; - cardId: CardId; - expandedCardSteps: ExpandedCardSteps; - finishedSteps: Set; - toggleTaskCompleteStatus: ToggleTaskCompleteStatus; - onStepClicked: OnStepClicked; - sectionId: SectionId; -}> = ({ - activeStepIds, - cardId, - expandedCardSteps, - finishedSteps, - toggleTaskCompleteStatus, - onStepClicked, - sectionId, -}) => { - const isExpandedCard = expandedCardSteps[cardId].isExpanded; - - const cardItem = useMemo(() => getCard({ cardId, sectionId }), [cardId, sectionId]); - const expandedSteps = useMemo( - () => new Set(expandedCardSteps[cardId]?.expandedSteps ?? []), - [cardId, expandedCardSteps] - ); - const cardItemPanelStyle = useCardItemStyles(); - - const cardClassNames = classnames( - 'card-item', - { - 'card-expanded': isExpandedCard, - }, - cardItemPanelStyle - ); - - const getCardStep = useCallback( - (stepId: StepId) => cardItem?.steps?.find((step) => step.id === stepId), - [cardItem?.steps] - ); - const steps = useMemo( - () => - activeStepIds?.reduce((acc, stepId) => { - const step = getCardStep(stepId); - if (step && cardItem) { - acc.push( - - ); - } - return acc; - }, []), - [ - activeStepIds, - cardItem, - expandedSteps, - finishedSteps, - getCardStep, - onStepClicked, - sectionId, - toggleTaskCompleteStatus, - ] - ); - - return cardItem && activeStepIds ? ( - - - {steps} - - - ) : null; -}; - -CardItemComponent.displayName = 'CardItemComponent'; -export const CardItem = React.memo(CardItemComponent); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/__mocks__/index.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/__mocks__/index.tsx deleted file mode 100644 index 73198936a1e79..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/__mocks__/index.tsx +++ /dev/null @@ -1,11 +0,0 @@ -/* - * 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 React from 'react'; - -export const CardStep = jest - .fn() - .mockReturnValue(({ title }: { title: string }) =>
{title}
); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/add_integration_image.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/add_integration_image.tsx deleted file mode 100644 index b9917c40e4056..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/add_integration_image.tsx +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 React from 'react'; -import connectToDataSources from '../../images/connect_to_existing_sources.png'; -import { ADD_INTEGRATIONS_IMAGE_TITLE } from '../../translations'; -import { ContentWrapper } from './content_wrapper'; - -const AddIntegrationsImageComponent = () => { - return ( - - {ADD_INTEGRATIONS_IMAGE_TITLE} - - ); -}; - -export const AddIntegrationsImage = React.memo(AddIntegrationsImageComponent); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/content_wrapper.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/content_wrapper.tsx deleted file mode 100644 index 7f67817d71d42..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/content_wrapper.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 classnames from 'classnames'; -import React from 'react'; -import { useStepContentStyles } from '../../styles/step_content.styles'; - -const ContentWrapperComponent: React.FC<{ children: React.ReactElement; shadow?: boolean }> = ({ - children, - shadow = true, -}) => { - const { getRightContentStyles } = useStepContentStyles(); - const rightContentStyles = getRightContentStyles({ shadow }); - const rightPanelContentClassNames = classnames('right-panel-content', rightContentStyles); - return
{children}
; -}; - -export const ContentWrapper = React.memo(ContentWrapperComponent); diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/create_project_step_image.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/create_project_step_image.tsx deleted file mode 100644 index 268863033f9e8..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/create_project_step_image.tsx +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 React from 'react'; -import createProjects from '../../images/create_projects.png'; -import { CREATE_PROJECT_TITLE } from '../../translations'; -import { ContentWrapper } from './content_wrapper'; - -const CreateProjectImageComponent = () => ( - - {CREATE_PROJECT_TITLE} - -); - -export const CreateProjectImage = React.memo(CreateProjectImageComponent); 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 deleted file mode 100644 index 181d4a797ebbc..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/card_step/content/data_ingestion_hub_video.tsx +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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 && ( -