77import React , { useReducer , useCallback , useEffect , useState } from 'react' ;
88import styled , { css } from 'styled-components' ;
99
10- import { EuiFlexGroup , EuiFlexItem , EuiButton , EuiSpacer , EuiCallOut } from '@elastic/eui' ;
11- import { noop , isEmpty } from 'lodash/fp' ;
10+ import {
11+ EuiFlexGroup ,
12+ EuiFlexItem ,
13+ EuiButton ,
14+ EuiCallOut ,
15+ EuiBottomBar ,
16+ EuiButtonEmpty ,
17+ } from '@elastic/eui' ;
18+ import { isEmpty } from 'lodash/fp' ;
1219import { useKibana } from '../../../../lib/kibana' ;
1320import { useConnectors } from '../../../../containers/case/configure/use_connectors' ;
1421import { useCaseConfigure } from '../../../../containers/case/configure/use_configure' ;
@@ -32,6 +39,9 @@ import { Mapping } from '../configure_cases/mapping';
3239import { SectionWrapper } from '../wrappers' ;
3340import { configureCasesReducer , State } from './reducer' ;
3441import * as i18n from './translations' ;
42+ import { getCaseUrl } from '../../../../components/link_to' ;
43+
44+ const CASE_URL = getCaseUrl ( ) ;
3545
3646const FormWrapper = styled . div `
3747 ${ ( { theme } ) => css `
@@ -68,6 +78,8 @@ const ConfigureCasesComponent: React.FC = () => {
6878 null
6979 ) ;
7080
81+ const [ actionBarVisible , setActionBarVisisble ] = useState ( false ) ;
82+
7183 const handleShowAddFlyout = useCallback ( ( ) => setAddFlyoutVisibility ( true ) , [ ] ) ;
7284
7385 const [ { connectorId, closureType, mapping } , dispatch ] = useReducer (
@@ -80,6 +92,7 @@ const ConfigureCasesComponent: React.FC = () => {
8092 type : 'setConnectorId' ,
8193 connectorId : newConnectorId ,
8294 } ) ;
95+ setActionBarVisisble ( true ) ;
8396 } , [ ] ) ;
8497
8598 const setClosureType = useCallback ( ( newClosureType : ClosureType ) => {
@@ -192,37 +205,41 @@ const ConfigureCasesComponent: React.FC = () => {
192205 setEditFlyoutVisibility = { setEditFlyoutVisibility }
193206 />
194207 </ SectionWrapper >
195- < SectionWrapper >
196- < EuiSpacer />
197- < EuiFlexGroup
198- alignItems = "center"
199- justifyContent = "flexEnd"
200- gutterSize = "xs"
201- responsive = { false }
202- >
203- < EuiFlexItem grow = { false } >
204- < EuiButton
205- fill = { false }
206- isDisabled = { isLoadingAny }
207- isLoading = { persistLoading }
208- onClick = { noop } // TO DO redirect to the main page of cases
209- >
210- { i18n . CANCEL }
211- </ EuiButton >
212- </ EuiFlexItem >
213- < EuiFlexItem grow = { false } >
214- < EuiButton
215- fill
216- iconType = "save"
217- isDisabled = { isLoadingAny }
218- isLoading = { persistLoading }
219- onClick = { handleSubmit }
220- >
221- { i18n . SAVE_CHANGES }
222- </ EuiButton >
223- </ EuiFlexItem >
224- </ EuiFlexGroup >
225- </ SectionWrapper >
208+ { actionBarVisible && (
209+ < EuiBottomBar >
210+ < EuiFlexGroup justifyContent = "flexEnd" alignItems = "center" >
211+ < EuiFlexItem grow = { false } >
212+ < EuiFlexGroup gutterSize = "s" >
213+ < EuiFlexItem grow = { false } >
214+ < EuiButtonEmpty
215+ color = "ghost"
216+ iconType = "cross"
217+ isDisabled = { isLoadingAny }
218+ isLoading = { persistLoading }
219+ aria-label = "Cancel"
220+ href = { CASE_URL }
221+ >
222+ { i18n . CANCEL }
223+ </ EuiButtonEmpty >
224+ </ EuiFlexItem >
225+ < EuiFlexItem grow = { false } >
226+ < EuiButton
227+ fill
228+ color = "secondary"
229+ iconType = "save"
230+ aria-label = "Save"
231+ isDisabled = { isLoadingAny }
232+ isLoading = { persistLoading }
233+ onClick = { handleSubmit }
234+ >
235+ { i18n . SAVE_CHANGES }
236+ </ EuiButton >
237+ </ EuiFlexItem >
238+ </ EuiFlexGroup >
239+ </ EuiFlexItem >
240+ </ EuiFlexGroup >
241+ </ EuiBottomBar >
242+ ) }
226243 < ActionsConnectorsContextProvider
227244 value = { {
228245 http,
0 commit comments