[Security Solution][Detections]Exceptions modal bugs (#72471)
This commit is contained in:
parent
0f964f6691
commit
4ccf1aed96
3 changed files with 15 additions and 4 deletions
|
@ -21,6 +21,7 @@ import {
|
|||
EuiCallOut,
|
||||
EuiText,
|
||||
} from '@elastic/eui';
|
||||
import { Status } from '../../../../../common/detection_engine/schemas/common/schemas';
|
||||
import { alertsIndexPattern } from '../../../../../common/endpoint/constants';
|
||||
import {
|
||||
ExceptionListItemSchema,
|
||||
|
@ -67,6 +68,7 @@ interface AddExceptionModalProps {
|
|||
};
|
||||
onCancel: () => void;
|
||||
onConfirm: (didCloseAlert: boolean) => void;
|
||||
alertStatus?: Status;
|
||||
}
|
||||
|
||||
const Modal = styled(EuiModal)`
|
||||
|
@ -105,6 +107,7 @@ export const AddExceptionModal = memo(function AddExceptionModal({
|
|||
alertData,
|
||||
onCancel,
|
||||
onConfirm,
|
||||
alertStatus,
|
||||
}: AddExceptionModalProps) {
|
||||
const { http } = useKibana().services;
|
||||
const [comment, setComment] = useState('');
|
||||
|
@ -183,7 +186,8 @@ export const AddExceptionModal = memo(function AddExceptionModal({
|
|||
if (indexPatternLoading === false && isSignalIndexLoading === false) {
|
||||
setShouldDisableBulkClose(
|
||||
entryHasListType(exceptionItemsToAdd) ||
|
||||
entryHasNonEcsType(exceptionItemsToAdd, indexPatterns)
|
||||
entryHasNonEcsType(exceptionItemsToAdd, indexPatterns) ||
|
||||
exceptionItemsToAdd.length === 0
|
||||
);
|
||||
}
|
||||
}, [
|
||||
|
@ -335,7 +339,7 @@ export const AddExceptionModal = memo(function AddExceptionModal({
|
|||
</ModalBodySection>
|
||||
<EuiHorizontalRule />
|
||||
<ModalBodySection>
|
||||
{alertData !== undefined && (
|
||||
{alertData !== undefined && alertStatus !== 'closed' && (
|
||||
<EuiFormRow fullWidth>
|
||||
<EuiCheckbox
|
||||
id="close-alert-on-add-add-exception-checkbox"
|
||||
|
|
|
@ -41,6 +41,7 @@ import {
|
|||
entryHasListType,
|
||||
entryHasNonEcsType,
|
||||
} from '../helpers';
|
||||
import { Loader } from '../../loader';
|
||||
|
||||
interface EditExceptionModalProps {
|
||||
ruleName: string;
|
||||
|
@ -124,7 +125,8 @@ export const EditExceptionModal = memo(function EditExceptionModal({
|
|||
if (indexPatternLoading === false && isSignalIndexLoading === false) {
|
||||
setShouldDisableBulkClose(
|
||||
entryHasListType(exceptionItemsToAdd) ||
|
||||
entryHasNonEcsType(exceptionItemsToAdd, indexPatterns)
|
||||
entryHasNonEcsType(exceptionItemsToAdd, indexPatterns) ||
|
||||
exceptionItemsToAdd.length === 0
|
||||
);
|
||||
}
|
||||
}, [
|
||||
|
@ -204,7 +206,11 @@ export const EditExceptionModal = memo(function EditExceptionModal({
|
|||
</ModalHeaderSubtitle>
|
||||
</ModalHeader>
|
||||
|
||||
{!isSignalIndexLoading && (
|
||||
{(addExceptionIsLoading || indexPatternLoading || isSignalIndexLoading) && (
|
||||
<Loader data-test-subj="loadingEditExceptionModal" size="xl" />
|
||||
)}
|
||||
|
||||
{!isSignalIndexLoading && !addExceptionIsLoading && !indexPatternLoading && (
|
||||
<>
|
||||
<ModalBodySection className="builder-section">
|
||||
<EuiText>{i18n.EXCEPTION_BUILDER_INFO}</EuiText>
|
||||
|
|
|
@ -458,6 +458,7 @@ export const AlertsTableComponent: React.FC<AlertsTableComponentProps> = ({
|
|||
alertData={addExceptionModalState.alertData}
|
||||
onCancel={onAddExceptionCancel}
|
||||
onConfirm={onAddExceptionConfirm}
|
||||
alertStatus={filterGroup}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
|
Loading…
Reference in a new issue