-
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][Exceptions] - Update add/edit exception flyouts #143127
Conversation
…ypress tests and unit tests
Pinging @elastic/security-solution (Team: SecuritySolution) |
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.
@yctercero Rules area LGTM
@elasticmachine merge upstream |
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.
this is excellent! a few comments for us to look at down the line. LGTM!
@@ -43,6 +45,29 @@ export const FieldComponent: React.FC<FieldProps> = ({ | |||
fieldInputWidth, | |||
onChange, | |||
}); | |||
|
|||
if (acceptsCustomOptions) { |
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.
nit: might be possible to remove this if statement and either conditionally pass the props or conditionally modify a props object.
return filterExceptionItems(exceptions); | ||
}, [exceptions]); | ||
|
||
// useEffect(() => { |
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.
nit: could probably remove this commented out code.
// We'll only block this when we know what rule we're dealing with. | ||
// When dealing with numerous rules that can be a mix of those that do and | ||
// don't work with large value lists we'll need to communicate that to the | ||
// user but not block. |
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.
good to know thanks for commenting this here.
// If data view is defined, it superceeds use of rule defined index patterns. | ||
// If no rule is available, use fields from default data view id. |
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.
This is not great that we have to make sure to remember data views supercede index patterns on rules. If we don't see customers using data views more then we should look into adding a boolean variable on the rule saying which data source to use.
// We only want to provide a non empty array if it's an ML rule and we were able to fetch | ||
// the index patterns, or if it's a rule not using data views. Otherwise, return an empty | ||
// empty array to avoid making the `useFetchIndex` call |
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.
better yet if we could encapsulate all this logic determining to select a data view vs an index pattern or if it's an ml rule use an empty array in another hook which could be used here...
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @yctercero |
Summary
Addresses #131668, #131671, #143014, #143015.
Updates the exception item add/edit flyout to match new designs and flows. While this can only be tested in our current UI from the rule details page, alerts, alert details flyout, it's been built out for the other cases where it will be used - rule bulk actions and exception list management.
To Do
rule_exceptions/components
Breaking down the changes
packages/kbn-securitysolution-autocomplete/
false
, so this custom option functionality is optionalx-pack/plugins/lists/public/exceptions/components/builder/
x-pack/plugins/security_solution/cypress/e2e/exceptions/
x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/
x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/
x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/
listTypes
since now the table isn't justendpoint
exceptions ordetection
exceptions, it can includerule_default
list typex-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card
x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/
x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_exception_flyout_data.tsx
data_view_id
if one is defined or theindex
to fetch the fieldsx-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/
Existing questions
list
?Addresses
#127696, #99597, #117289, #99022, #135254, #102460, #116586
Screenshots
Shows exception item that is part of a shared list
Add endpoint exception
Edit endpoint exception
Add rule exception
Edit rule exception
Checklist
For maintainers