mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[8.6] [Security Solution] Fixes bulk close alerts from exception flyout type bug (#150765) (#150783)
# Backport This will backport the following commits from `main` to `8.6`: - [[Security Solution] Fixes bulk close alerts from exception flyout type bug (#150765)](https://github.com/elastic/kibana/pull/150765) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Davis Plumlee","email":"56367316+dplumlee@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-02-09T21:00:07Z","message":"[Security Solution] Fixes bulk close alerts from exception flyout type bug (#150765)","sha":"216fb3a1806d67c35e7ee84353d4d6460f87ad85","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team: SecuritySolution","Team:Detection Alerts","backport:prev-minor","v8.7.0","v8.6.2","v8.8.0"],"number":150765,"url":"https://github.com/elastic/kibana/pull/150765","mergeCommit":{"message":"[Security Solution] Fixes bulk close alerts from exception flyout type bug (#150765)","sha":"216fb3a1806d67c35e7ee84353d4d6460f87ad85"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.6"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.6","label":"v8.6.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/150765","number":150765,"mergeCommit":{"message":"[Security Solution] Fixes bulk close alerts from exception flyout type bug (#150765)","sha":"216fb3a1806d67c35e7ee84353d4d6460f87ad85"}}]}] BACKPORT--> Co-authored-by: Davis Plumlee <56367316+dplumlee@users.noreply.github.com>
This commit is contained in:
parent
afa8d4edac
commit
6de41514aa
2 changed files with 12 additions and 1 deletions
|
@ -384,6 +384,16 @@ describe('Exception helpers', () => {
|
|||
const result = prepareExceptionItemsForBulkClose(payload);
|
||||
expect(result).toEqual(expected);
|
||||
});
|
||||
|
||||
test("should strip out any comments in the exceptions for bulk close'", () => {
|
||||
const exceptionItemWithComment = {
|
||||
...getExceptionListItemSchemaMock(),
|
||||
comments: getCommentsArrayMock(),
|
||||
};
|
||||
const payload = [exceptionItemWithComment];
|
||||
const result = prepareExceptionItemsForBulkClose(payload);
|
||||
expect(result).toEqual([getExceptionListItemSchemaMock()]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#lowercaseHashValues', () => {
|
||||
|
|
|
@ -154,9 +154,10 @@ export const prepareExceptionItemsForBulkClose = (
|
|||
return {
|
||||
...item,
|
||||
entries: newEntries,
|
||||
comments: [], // Strips out unneeded comments attribute for bulk close as they are not needed and are throwing type errors
|
||||
};
|
||||
} else {
|
||||
return item;
|
||||
return { ...item, comments: [] };
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue