-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
245 additions
and
41 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
13 changes: 13 additions & 0 deletions
13
...ages/kbn-securitysolution-io-ts-list-types/src/common/include_expired_exceptions/index.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,13 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
|
||
import * as t from 'io-ts'; | ||
|
||
export const include_expired_exceptions = t.keyof({ true: null, false: null }); |
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
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
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
50 changes: 50 additions & 0 deletions
50
...ins/security_solution/public/exceptions/components/export_exceptions_list_modal/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,50 @@ | ||
/* | ||
* 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, useCallback, useState } from 'react'; | ||
|
||
import { EuiConfirmModal, EuiSwitch } from '@elastic/eui'; | ||
import * as i18n from '../../translations'; | ||
|
||
interface ExportExceptionsListModalProps { | ||
handleCloseModal: () => void; | ||
onModalConfirm: (includeExpired: boolean) => void; | ||
} | ||
|
||
export const ExportExceptionsListModal = memo<ExportExceptionsListModalProps>( | ||
({ handleCloseModal, onModalConfirm }) => { | ||
const [exportExpired, setExportExpired] = useState(true); | ||
|
||
const handleSwitchChange = useCallback(() => { | ||
setExportExpired(!exportExpired); | ||
}, [setExportExpired, exportExpired]); | ||
|
||
const handleConfirm = useCallback(() => { | ||
onModalConfirm(exportExpired); | ||
handleCloseModal(); | ||
}, [exportExpired, handleCloseModal, onModalConfirm]); | ||
|
||
return ( | ||
<EuiConfirmModal | ||
title={i18n.EXPORT_MODAL_TITLE} | ||
onCancel={handleCloseModal} | ||
onConfirm={handleConfirm} | ||
cancelButtonText={i18n.EXPORT_MODAL_CANCEL_BUTTON} | ||
confirmButtonText={i18n.EXPORT_MODAL_CONFIRM_BUTTON} | ||
defaultFocusedButton="confirm" | ||
> | ||
<EuiSwitch | ||
label={i18n.EXPORT_MODAL_INCLUDE_SWITCH_LABEL} | ||
checked={exportExpired} | ||
onChange={handleSwitchChange} | ||
/> | ||
</EuiConfirmModal> | ||
); | ||
} | ||
); | ||
|
||
ExportExceptionsListModal.displayName = 'ExportExceptionsListModal'; |
Oops, something went wrong.