mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Security Solution] Fixes custom index fields not appearing in exceptions modal (#122387)
This commit is contained in:
parent
683ab102ae
commit
fc6b969233
6 changed files with 29 additions and 1 deletions
|
@ -74,4 +74,5 @@ export interface Ecs {
|
|||
Target?: Target;
|
||||
dll?: DllEcs;
|
||||
'kibana.alert.workflow_status'?: 'open' | 'acknowledged' | 'in-progress' | 'closed';
|
||||
'kibana.alert.rule.parameters'?: { index: string[] };
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import {
|
|||
LOADING_SPINNER,
|
||||
EXCEPTION_ITEM_CONTAINER,
|
||||
ADD_EXCEPTIONS_BTN,
|
||||
EXCEPTION_FIELD_LIST,
|
||||
} from '../../screens/exceptions';
|
||||
|
||||
import { ALERTS_URL } from '../../urls/navigation';
|
||||
|
@ -196,4 +197,13 @@ describe('Exceptions modal', () => {
|
|||
|
||||
closeExceptionBuilderModal();
|
||||
});
|
||||
|
||||
it('Contains custom index fields', () => {
|
||||
cy.get(ADD_EXCEPTIONS_BTN).click({ force: true });
|
||||
|
||||
cy.get(FIELD_INPUT).eq(0).click({ force: true });
|
||||
cy.get(EXCEPTION_FIELD_LIST).contains('unique_value.test');
|
||||
|
||||
closeExceptionBuilderModal();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -56,3 +56,6 @@ export const EXCEPTIONS_TABLE_MODAL = '[data-test-subj="referenceErrorModal"]';
|
|||
export const EXCEPTIONS_TABLE_MODAL_CONFIRM_BTN = '[data-test-subj="confirmModalConfirmButton"]';
|
||||
|
||||
export const EXCEPTION_ITEM_CONTAINER = '[data-test-subj="exceptionEntriesContainer"]';
|
||||
|
||||
export const EXCEPTION_FIELD_LIST =
|
||||
'[data-test-subj="comboBoxOptionsList fieldAutocompleteComboBox-optionsList"]';
|
||||
|
|
|
@ -121,6 +121,9 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps & PropsFromRedux
|
|||
}
|
||||
}, [timelineId, globalQuery, timelineQuery, routeProps]);
|
||||
|
||||
const ruleIndex =
|
||||
ecsRowData['kibana.alert.rule.parameters']?.index ?? ecsRowData?.signal?.rule?.index;
|
||||
|
||||
const {
|
||||
exceptionModalType,
|
||||
onAddExceptionCancel,
|
||||
|
@ -128,7 +131,7 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps & PropsFromRedux
|
|||
onAddExceptionTypeClick,
|
||||
ruleIndices,
|
||||
} = useExceptionModal({
|
||||
ruleIndex: ecsRowData?.signal?.rule?.index,
|
||||
ruleIndex,
|
||||
refetch: refetchAll,
|
||||
timelineId,
|
||||
});
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
"agent": {
|
||||
"name": "bond"
|
||||
},
|
||||
"unique_value": {
|
||||
"test": "test field"
|
||||
},
|
||||
"user" : [
|
||||
{
|
||||
"name" : "john",
|
||||
|
|
|
@ -25,6 +25,14 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"unique_value": {
|
||||
"properties": {
|
||||
"test": {
|
||||
"ignore_above": 1024,
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue