This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SIEM][CASE] Init Configure Case Page (elastic#58121)
* [SIEM][CASE] Init configure cases * [SIEM][CASE] Translate header title * [SIEM][CASE] Add back link * [SIEM][CASE] Add default options to header page * [SIEM][CASE] Create configure cases page redirections and links * [SIEM][CASE] Add configure cases button * [SIEM][CASE] Change translation variable * [SIEM][CASE] Create wrappers * [SIEM][CASE]Create section wrapper * [SIEM][CASE] Switch to new wrapper * [SIEM][CASE] Add translations * [SIEM][CASE] Add connectors dropdown component * [SIEM][CASE] Add connectors component * [SIEM][CASE] Show connectors * [SIEM][CASE] Create add new connector button * [SIEM][CASE] Change values * [SIEM][CASE] Use state for connectors dropdown * [SIEM][CASE] Remove unnecessary attribute * [SIEM][CASE] Remove timeline in configuration page * [SIEM][CASE] Remove text from gear button * [SIEM][CASE] make show timeline more generic so we can re-use if need it Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
5046a3a
commit 967bef7
Showing
17 changed files
with
345 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
x-pack/legacy/plugins/siem/public/pages/case/components/case_header_page/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* 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<HeaderPageProps> = props => <HeaderPage {...props} />; | ||
|
||
CaseHeaderPageComponent.defaultProps = { | ||
badgeOptions: { | ||
beta: true, | ||
text: i18n.PAGE_BADGE_LABEL, | ||
tooltip: i18n.PAGE_BADGE_TOOLTIP, | ||
}, | ||
}; | ||
|
||
export const CaseHeaderPage = React.memo(CaseHeaderPageComponent); |
16 changes: 16 additions & 0 deletions
16
x-pack/legacy/plugins/siem/public/pages/case/components/case_header_page/translations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* 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.', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/connectors.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* 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 = ( | ||
<EuiFlexGroup justifyContent="spaceBetween"> | ||
<EuiFlexItem grow={false}>{i18n.INCIDENT_MANAGEMENT_SYSTEM_LABEL}</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiLink>{i18n.ADD_NEW_CONNECTOR}</EuiLink> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
|
||
return ( | ||
<EuiDescribedFormGroup | ||
fullWidth | ||
title={<h3>{i18n.INCIDENT_MANAGEMENT_SYSTEM_TITLE}</h3>} | ||
description={i18n.INCIDENT_MANAGEMENT_SYSTEM_DESC} | ||
> | ||
<EuiFormRowExtended fullWidth label={dropDownLabel}> | ||
<ConnectorsDropdown /> | ||
</EuiFormRowExtended> | ||
</EuiDescribedFormGroup> | ||
); | ||
}; | ||
|
||
export const Connectors = React.memo(ConnectorsComponent); |
56 changes: 56 additions & 0 deletions
56
...y/plugins/siem/public/pages/case/components/configure_cases/connectors_dropdown/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* 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<EuiSuperSelectOption<string>> = [ | ||
{ | ||
value: 'no-connector', | ||
inputDisplay: ( | ||
<> | ||
<EuiIconExtended type="minusInCircle" size={ICON_SIZE} /> | ||
<span>{i18n.NO_CONNECTOR}</span> | ||
</> | ||
), | ||
'data-test-subj': 'no-connector', | ||
}, | ||
{ | ||
value: 'servicenow-connector', | ||
inputDisplay: ( | ||
<> | ||
<EuiIconExtended type="logoWebhook" size={ICON_SIZE} /> | ||
<span>{'My ServiceNow connector'}</span> | ||
</> | ||
), | ||
'data-test-subj': 'servicenow-connector', | ||
}, | ||
]; | ||
|
||
const ConnectorsDropdownComponent: React.FC = () => { | ||
const [selectedConnector, selectConnector] = useState(connectors[0].value); | ||
const onChange = useCallback(connector => selectConnector(connector), [selectedConnector]); | ||
|
||
return ( | ||
<EuiSuperSelect | ||
options={connectors} | ||
valueOfSelected={selectedConnector} | ||
fullWidth | ||
onChange={onChange} | ||
/> | ||
); | ||
}; | ||
|
||
export const ConnectorsDropdown = React.memo(ConnectorsDropdownComponent); |
37 changes: 37 additions & 0 deletions
37
x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/translations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* 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', | ||
}); |
22 changes: 22 additions & 0 deletions
22
x-pack/legacy/plugins/siem/public/pages/case/components/wrappers/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* 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; | ||
`; |
54 changes: 54 additions & 0 deletions
54
x-pack/legacy/plugins/siem/public/pages/case/configure_cases.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* 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<string, string> = { | ||
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 = () => ( | ||
<> | ||
<WrapperPage style={wrapperPageStyle}> | ||
<SectionWrapper> | ||
<CaseHeaderPage title={i18n.CONFIGURE_CASES_PAGE_TITLE} backOptions={backOptions} /> | ||
</SectionWrapper> | ||
<WhitePageWrapper> | ||
<FormWrapper> | ||
<SectionWrapper> | ||
<Connectors /> | ||
</SectionWrapper> | ||
</FormWrapper> | ||
</WhitePageWrapper> | ||
</WrapperPage> | ||
<SpyRoute /> | ||
</> | ||
); | ||
|
||
export const ConfigureCasesPage = React.memo(ConfigureCasesPageComponent); |
Oops, something went wrong.