diff --git a/x-pack/legacy/plugins/siem/public/components/link_to/index.ts b/x-pack/legacy/plugins/siem/public/components/link_to/index.ts index a1c1f78e398e33..c93b415e017bb7 100644 --- a/x-pack/legacy/plugins/siem/public/components/link_to/index.ts +++ b/x-pack/legacy/plugins/siem/public/components/link_to/index.ts @@ -17,8 +17,6 @@ export { getCaseDetailsUrl, getCaseUrl, getCreateCaseUrl, - getConfigureCasesUrl, RedirectToCasePage, RedirectToCreatePage, - RedirectToConfigureCasesPage, } from './redirect_to_case'; diff --git a/x-pack/legacy/plugins/siem/public/components/link_to/link_to.tsx b/x-pack/legacy/plugins/siem/public/components/link_to/link_to.tsx index 08e4d1a3494e06..c08b429dc4625e 100644 --- a/x-pack/legacy/plugins/siem/public/components/link_to/link_to.tsx +++ b/x-pack/legacy/plugins/siem/public/components/link_to/link_to.tsx @@ -20,11 +20,7 @@ import { RedirectToHostsPage, RedirectToHostDetailsPage } from './redirect_to_ho import { RedirectToNetworkPage } from './redirect_to_network'; import { RedirectToOverviewPage } from './redirect_to_overview'; import { RedirectToTimelinesPage } from './redirect_to_timelines'; -import { - RedirectToCasePage, - RedirectToCreatePage, - RedirectToConfigureCasesPage, -} from './redirect_to_case'; +import { RedirectToCasePage, RedirectToCreatePage } from './redirect_to_case'; import { DetectionEngineTab } from '../../pages/detection_engine/types'; interface LinkToPageProps { @@ -47,11 +43,6 @@ export const LinkToPage = React.memo(({ match }) => ( component={RedirectToCreatePage} path={`${match.url}/:pageName(${SiemPageName.case})/create`} /> - ; -export const RedirectToConfigureCasesPage = () => ( - -); const baseCaseUrl = `#/link-to/${SiemPageName.case}`; export const getCaseUrl = () => baseCaseUrl; export const getCaseDetailsUrl = (detailName: string) => `${baseCaseUrl}/${detailName}`; export const getCreateCaseUrl = () => `${baseCaseUrl}/create`; -export const getConfigureCasesUrl = () => `${baseCaseUrl}/configure`; diff --git a/x-pack/legacy/plugins/siem/public/pages/case/case.tsx b/x-pack/legacy/plugins/siem/public/pages/case/case.tsx index 15a6d076f10095..1206ec950deed1 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/case.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/case/case.tsx @@ -6,29 +6,30 @@ import React from 'react'; -import { EuiButton, EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { CaseHeaderPage } from './components/case_header_page'; +import { EuiButton, EuiFlexGroup } from '@elastic/eui'; +import { HeaderPage } from '../../components/header_page'; import { WrapperPage } from '../../components/wrapper_page'; import { AllCases } from './components/all_cases'; import { SpyRoute } from '../../utils/route/spy_routes'; import * as i18n from './translations'; -import { getCreateCaseUrl, getConfigureCasesUrl } from '../../components/link_to'; +import { getCreateCaseUrl } from '../../components/link_to'; + +const badgeOptions = { + beta: true, + text: i18n.PAGE_BADGE_LABEL, + tooltip: i18n.PAGE_BADGE_TOOLTIP, +}; export const CasesPage = React.memo(() => ( <> - + - - - {i18n.CREATE_TITLE} - - - - - + + {i18n.CREATE_TITLE} + - + diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/case_header_page/index.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/case_header_page/index.tsx deleted file mode 100644 index ae2664ca6e839d..00000000000000 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/case_header_page/index.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; - * you may not use this file except in compliance with the Elastic License. - */ - -import React from 'react'; - -import { HeaderPage, HeaderPageProps } from '../../../../components/header_page'; -import * as i18n from './translations'; - -const CaseHeaderPageComponent: React.FC = props => ; - -CaseHeaderPageComponent.defaultProps = { - badgeOptions: { - beta: true, - text: i18n.PAGE_BADGE_LABEL, - tooltip: i18n.PAGE_BADGE_TOOLTIP, - }, -}; - -export const CaseHeaderPage = React.memo(CaseHeaderPageComponent); diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/case_header_page/translations.ts b/x-pack/legacy/plugins/siem/public/pages/case/components/case_header_page/translations.ts deleted file mode 100644 index 9fcad926c03b84..00000000000000 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/case_header_page/translations.ts +++ /dev/null @@ -1,16 +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; - * you may not use this file except in compliance with the Elastic License. - */ - -import { i18n } from '@kbn/i18n'; - -export const PAGE_BADGE_LABEL = i18n.translate('xpack.siem.case.caseView.pageBadgeLabel', { - defaultMessage: 'Beta', -}); - -export const PAGE_BADGE_TOOLTIP = i18n.translate('xpack.siem.case.caseView.pageBadgeTooltip', { - defaultMessage: - 'Case Workflow is still in beta. Please help us improve by reporting issues or bugs in the Kibana repo.', -}); diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/case_view/index.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/case_view/index.tsx index df3e30a698b56e..5cd71c5855d34f 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/case_view/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/case/components/case_view/index.tsx @@ -34,7 +34,6 @@ import { UserActionTree } from '../user_action_tree'; import { UserList } from '../user_list'; import { useUpdateCase } from '../../../../containers/case/use_update_case'; import { WrapperPage } from '../../../../components/wrapper_page'; -import { WhitePageWrapper } from '../wrappers'; interface Props { caseId: string; @@ -53,6 +52,14 @@ const MyWrapper = styled(WrapperPage)` padding-bottom: 0; `; +const BackgroundWrapper = styled.div` + ${({ theme }) => css` + background-color: ${theme.eui.euiColorEmptyShade}; + border-top: ${theme.eui.euiBorderThin}; + height: 100%; + `} +`; + export interface CaseProps { caseId: string; initialData: Case; @@ -272,7 +279,7 @@ export const CaseComponent = React.memo(({ caseId, initialData, isLoa - + @@ -298,7 +305,7 @@ export const CaseComponent = React.memo(({ caseId, initialData, isLoa - + ); }); diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/connectors.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/connectors.tsx deleted file mode 100644 index 561464e44c7032..00000000000000 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/connectors.tsx +++ /dev/null @@ -1,52 +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; - * you may not use this file except in compliance with the Elastic License. - */ - -import React from 'react'; -import { - EuiDescribedFormGroup, - EuiFormRow, - EuiFlexGroup, - EuiFlexItem, - EuiLink, -} from '@elastic/eui'; - -import styled from 'styled-components'; - -import { ConnectorsDropdown } from './connectors_dropdown'; -import * as i18n from './translations'; - -const EuiFormRowExtended = styled(EuiFormRow)` - .euiFormRow__labelWrapper { - .euiFormRow__label { - width: 100%; - } - } -`; - -const ConnectorsComponent: React.FC = () => { - const dropDownLabel = ( - - {i18n.INCIDENT_MANAGEMENT_SYSTEM_LABEL} - - {i18n.ADD_NEW_CONNECTOR} - - - ); - - return ( - {i18n.INCIDENT_MANAGEMENT_SYSTEM_TITLE}} - description={i18n.INCIDENT_MANAGEMENT_SYSTEM_DESC} - > - - - - - ); -}; - -export const Connectors = React.memo(ConnectorsComponent); diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/connectors_dropdown/index.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/connectors_dropdown/index.tsx deleted file mode 100644 index c00baa04d78a0b..00000000000000 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/connectors_dropdown/index.tsx +++ /dev/null @@ -1,56 +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; - * you may not use this file except in compliance with the Elastic License. - */ - -import React, { useState, useCallback } from 'react'; -import { EuiSuperSelect, EuiIcon, EuiSuperSelectOption } from '@elastic/eui'; -import styled from 'styled-components'; - -import * as i18n from '../translations'; - -const ICON_SIZE = 'm'; - -const EuiIconExtended = styled(EuiIcon)` - margin-right: 13px; -`; - -const connectors: Array> = [ - { - value: 'no-connector', - inputDisplay: ( - <> - - {i18n.NO_CONNECTOR} - - ), - 'data-test-subj': 'no-connector', - }, - { - value: 'servicenow-connector', - inputDisplay: ( - <> - - {'My ServiceNow connector'} - - ), - 'data-test-subj': 'servicenow-connector', - }, -]; - -const ConnectorsDropdownComponent: React.FC = () => { - const [selectedConnector, selectConnector] = useState(connectors[0].value); - const onChange = useCallback(connector => selectConnector(connector), [selectedConnector]); - - return ( - - ); -}; - -export const ConnectorsDropdown = React.memo(ConnectorsDropdownComponent); diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/translations.ts b/x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/translations.ts deleted file mode 100644 index 54d256b143f603..00000000000000 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/translations.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; - * you may not use this file except in compliance with the Elastic License. - */ - -import { i18n } from '@kbn/i18n'; - -export const INCIDENT_MANAGEMENT_SYSTEM_TITLE = i18n.translate( - 'xpack.siem.case.configureCases.incidentManagementSystemTitle', - { - defaultMessage: 'Connect to third-party incident management system', - } -); - -export const INCIDENT_MANAGEMENT_SYSTEM_DESC = i18n.translate( - 'xpack.siem.case.configureCases.incidentManagementSystemDesc', - { - defaultMessage: - 'You may optionally connect SIEM cases to a third-party incident management system of your choosing. This will allow you to push case data as an incident in your chosen third-party system.', - } -); - -export const INCIDENT_MANAGEMENT_SYSTEM_LABEL = i18n.translate( - 'xpack.siem.case.configureCases.incidentManagementSystemLabel', - { - defaultMessage: 'Incident management system', - } -); - -export const NO_CONNECTOR = i18n.translate('xpack.siem.case.configureCases.noConnector', { - defaultMessage: 'No connector selected', -}); - -export const ADD_NEW_CONNECTOR = i18n.translate('xpack.siem.case.configureCases.addNewConnector', { - defaultMessage: 'Add new connector option', -}); diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/wrappers/index.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/wrappers/index.tsx deleted file mode 100644 index 772d78f948b798..00000000000000 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/wrappers/index.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; - * you may not use this file except in compliance with the Elastic License. - */ - -import styled, { css } from 'styled-components'; - -export const WhitePageWrapper = styled.div` - ${({ theme }) => css` - background-color: ${theme.eui.euiColorEmptyShade}; - border-top: ${theme.eui.euiBorderThin}; - height: 100%; - min-height: 100vh; - `} -`; - -export const SectionWrapper = styled.div` - box-sizing: content-box; - margin: 0 auto; - max-width: 1175px; -`; diff --git a/x-pack/legacy/plugins/siem/public/pages/case/configure_cases.tsx b/x-pack/legacy/plugins/siem/public/pages/case/configure_cases.tsx deleted file mode 100644 index 018f9dc9ade52a..00000000000000 --- a/x-pack/legacy/plugins/siem/public/pages/case/configure_cases.tsx +++ /dev/null @@ -1,54 +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; - * you may not use this file except in compliance with the Elastic License. - */ - -import React from 'react'; -import styled, { css } from 'styled-components'; - -import { WrapperPage } from '../../components/wrapper_page'; -import { CaseHeaderPage } from './components/case_header_page'; -import { SpyRoute } from '../../utils/route/spy_routes'; -import { getCaseUrl } from '../../components/link_to'; -import { WhitePageWrapper, SectionWrapper } from './components/wrappers'; -import { Connectors } from './components/configure_cases/connectors'; -import * as i18n from './translations'; - -const backOptions = { - href: getCaseUrl(), - text: i18n.BACK_TO_ALL, -}; - -const wrapperPageStyle: Record = { - paddingLeft: '0', - paddingRight: '0', - paddingBottom: '0', -}; - -export const FormWrapper = styled.div` - ${({ theme }) => css` - padding-top: ${theme.eui.paddingSizes.l}; - padding-bottom: ${theme.eui.paddingSizes.l}; - `} -`; - -const ConfigureCasesPageComponent: React.FC = () => ( - <> - - - - - - - - - - - - - - -); - -export const ConfigureCasesPage = React.memo(ConfigureCasesPageComponent); diff --git a/x-pack/legacy/plugins/siem/public/pages/case/create_case.tsx b/x-pack/legacy/plugins/siem/public/pages/case/create_case.tsx index 2c7525264f71be..9bc356517cc686 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/create_case.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/case/create_case.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { WrapperPage } from '../../components/wrapper_page'; import { Create } from './components/create'; import { SpyRoute } from '../../utils/route/spy_routes'; -import { CaseHeaderPage } from './components/case_header_page'; +import { HeaderPage } from '../../components/header_page'; import * as i18n from './translations'; import { getCaseUrl } from '../../components/link_to'; @@ -17,11 +17,15 @@ const backOptions = { href: getCaseUrl(), text: i18n.BACK_TO_ALL, }; - +const badgeOptions = { + beta: true, + text: i18n.PAGE_BADGE_LABEL, + tooltip: i18n.PAGE_BADGE_TOOLTIP, +}; export const CreateCasePage = React.memo(() => ( <> - + diff --git a/x-pack/legacy/plugins/siem/public/pages/case/index.tsx b/x-pack/legacy/plugins/siem/public/pages/case/index.tsx index 1bde9de1535b52..9bd91b1c6d62dd 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/case/index.tsx @@ -11,12 +11,10 @@ import { SiemPageName } from '../home/types'; import { CaseDetailsPage } from './case_details'; import { CasesPage } from './case'; import { CreateCasePage } from './create_case'; -import { ConfigureCasesPage } from './configure_cases'; const casesPagePath = `/:pageName(${SiemPageName.case})`; const caseDetailsPagePath = `${casesPagePath}/:detailName`; const createCasePagePath = `${casesPagePath}/create`; -const configureCasesPagePath = `${casesPagePath}/configure`; const CaseContainerComponent: React.FC = () => ( @@ -26,9 +24,6 @@ const CaseContainerComponent: React.FC = () => ( - - - diff --git a/x-pack/legacy/plugins/siem/public/pages/case/translations.ts b/x-pack/legacy/plugins/siem/public/pages/case/translations.ts index 265af0bde547f2..4e878ba58411e4 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/translations.ts +++ b/x-pack/legacy/plugins/siem/public/pages/case/translations.ts @@ -57,6 +57,15 @@ export const LAST_UPDATED = i18n.translate('xpack.siem.case.caseView.updatedAt', defaultMessage: 'Last updated', }); +export const PAGE_BADGE_LABEL = i18n.translate('xpack.siem.case.caseView.pageBadgeLabel', { + defaultMessage: 'Beta', +}); + +export const PAGE_BADGE_TOOLTIP = i18n.translate('xpack.siem.case.caseView.pageBadgeTooltip', { + defaultMessage: + 'Case Workflow is still in beta. Please help us improve by reporting issues or bugs in the Kibana repo.', +}); + export const PAGE_SUBTITLE = i18n.translate('xpack.siem.case.caseView.pageSubtitle', { defaultMessage: 'Case Workflow Management within the Elastic SIEM', }); @@ -93,14 +102,3 @@ export const NO_TAGS = i18n.translate('xpack.siem.case.caseView.noTags', { export const TITLE_REQUIRED = i18n.translate('xpack.siem.case.createCase.titleFieldRequiredError', { defaultMessage: 'A title is required.', }); - -export const CONFIGURE_CASES_PAGE_TITLE = i18n.translate( - 'xpack.siem.case.configureCases.headerTitle', - { - defaultMessage: 'Configure cases', - } -); - -export const CONFIGURE_CASES_BUTTON = i18n.translate('xpack.siem.case.configureCasesButton', { - defaultMessage: 'Configure cases', -}); diff --git a/x-pack/legacy/plugins/siem/public/utils/timeline/use_show_timeline.tsx b/x-pack/legacy/plugins/siem/public/utils/timeline/use_show_timeline.tsx deleted file mode 100644 index e969330b809ff1..00000000000000 --- a/x-pack/legacy/plugins/siem/public/utils/timeline/use_show_timeline.tsx +++ /dev/null @@ -1,31 +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; - * you may not use this file except in compliance with the Elastic License. - */ - -import { useLocation } from 'react-router-dom'; - -import { useState, useEffect } from 'react'; -import { SiemPageName } from '../../pages/home/types'; - -const hideTimelineForRoutes = [`/${SiemPageName.case}/configure`]; - -export const useShowTimeline = () => { - const currentLocation = useLocation(); - const [showTimeline, setShowTimeline] = useState( - !hideTimelineForRoutes.includes(currentLocation.pathname) - ); - - useEffect(() => { - if (hideTimelineForRoutes.includes(currentLocation.pathname)) { - if (showTimeline) { - setShowTimeline(false); - } - } else if (!showTimeline) { - setShowTimeline(true); - } - }, [currentLocation.pathname]); - - return [showTimeline]; -};