-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution][Bulk actions]- Fix bulk actions data views behavior #138448
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -35,6 +35,10 @@ const applyBulkActionEditToRuleParams = ( | |||||
"Index patterns can't be added. Machine learning rule doesn't have index patterns property" | ||||||
); | ||||||
|
||||||
if (ruleParams.dataViewId != null && !action.overwrite_data_views) { | ||||||
break; | ||||||
} | ||||||
|
||||||
if (action.overwrite_data_views) { | ||||||
ruleParams.dataViewId = undefined; | ||||||
} | ||||||
|
@@ -48,6 +52,14 @@ const applyBulkActionEditToRuleParams = ( | |||||
"Index patterns can't be deleted. Machine learning rule doesn't have index patterns property" | ||||||
); | ||||||
|
||||||
if (ruleParams.dataViewId != null && !action.overwrite_data_views) { | ||||||
break; | ||||||
} | ||||||
|
||||||
if (action.overwrite_data_views) { | ||||||
ruleParams.dataViewId = undefined; | ||||||
} | ||||||
|
||||||
if (ruleParams.index) { | ||||||
ruleParams.index = deleteItemsFromArray(ruleParams.index, action.value); | ||||||
} | ||||||
|
@@ -59,6 +71,10 @@ const applyBulkActionEditToRuleParams = ( | |||||
"Index patterns can't be overwritten. Machine learning rule doesn't have index patterns property" | ||||||
); | ||||||
|
||||||
if (ruleParams.dataViewId != null && !action.overwrite_data_views) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: maybe encapsulate this in a declarative helper? e.g.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏽 I think there's a different helper method @banderror had suggested we could use. Can definitely cleanup/revisit post 8.4. |
||||||
break; | ||||||
} | ||||||
|
||||||
if (action.overwrite_data_views) { | ||||||
ruleParams.dataViewId = undefined; | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯