Skip to content

Commit

Permalink
[8.6] Remove id from item list (#146805) (#147033)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.6`:
- [Remove id from item list
(#146805)](#146805)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Khristinin
Nikita","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-12-05T18:01:02Z","message":"Remove
id from item list (#146805)\n\n## Remove id from item list when try to
close alerts during update\r\nexceptions\r\nclose:
https://github.com/elastic/kibana/issues/146661\r\n\r\nCo-authored-by:
Kibana Machine
<[email protected]>","sha":"7261175571b0bcfd68c538067c60eac12dad84e1","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:prev-minor","v8.7.0"],"number":146805,"url":"https://github.com/elastic/kibana/pull/146805","mergeCommit":{"message":"Remove
id from item list (#146805)\n\n## Remove id from item list when try to
close alerts during update\r\nexceptions\r\nclose:
https://github.com/elastic/kibana/issues/146661\r\n\r\nCo-authored-by:
Kibana Machine
<[email protected]>","sha":"7261175571b0bcfd68c538067c60eac12dad84e1"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146805","number":146805,"mergeCommit":{"message":"Remove
id from item list (#146805)\n\n## Remove id from item list when try to
close alerts during update\r\nexceptions\r\nclose:
https://github.com/elastic/kibana/issues/146661\r\n\r\nCo-authored-by:
Kibana Machine
<[email protected]>","sha":"7261175571b0bcfd68c538067c60eac12dad84e1"}}]}]
BACKPORT-->

Co-authored-by: Khristinin Nikita <[email protected]>
  • Loading branch information
kibanamachine and nkhristinin authored Dec 5, 2022
1 parent a91d495 commit 9b8e563
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import type { EuiCommentProps } from '@elastic/eui';
import { EuiText, EuiAvatar } from '@elastic/eui';
import { capitalize } from 'lodash';
import { capitalize, omit } from 'lodash';
import moment from 'moment';

import type {
Expand Down Expand Up @@ -143,11 +143,12 @@ export const prepareExceptionItemsForBulkClose = (
return exceptionItems.map((item: ExceptionListItemSchema) => {
if (item.entries !== undefined) {
const newEntries = item.entries.map((itemEntry: Entry | EntryNested) => {
const entry = omit(itemEntry, 'id') as Entry | EntryNested;
return {
...itemEntry,
field: itemEntry.field.startsWith('event.')
? itemEntry.field.replace(/^event./, `${ALERT_ORIGINAL_EVENT}.`)
: itemEntry.field,
...entry,
field: entry.field.startsWith('event.')
? entry.field.replace(/^event./, `${ALERT_ORIGINAL_EVENT}.`)
: entry.field,
};
});
return {
Expand Down

0 comments on commit 9b8e563

Please sign in to comment.