-
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] Migrate rules table tags filter to EuiSelectable #149508
Conversation
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
9810f80
to
471bf0c
Compare
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.
Checked out, tested locally and LGTM! 👍 Thanks for the cleanup here @maximpn 🙂
This is especially nice as we can now more easily support tag exclusion (which will make users really happy :) by adding the allowExclusions
prop on EuiSelectable
.
I tried adding it when testing, but looks like we'll need a little refactoring with how selectedTags
are used between these components and the RulesTableContext (it's just an inclusive string list now, so would need to expand to match something similar to EuiSelectableOption
). Will also need to add filter negation logic too, but that should be it! 🚀
searchProps={{ | ||
placeholder: 'Search tags', | ||
}} | ||
aria-label="Rules tag search" |
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.
Not sure how these were missed before, but they should be i18n
keys.
noMatchesMessage={i18n.NO_TAGS_AVAILABLE} | ||
> | ||
{(list, search) => ( | ||
<div style={{ width: 275 }}> |
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.
let's use a variable for 275
https://github.com/elastic/kibana/blob/main/STYLEGUIDE.mdx#magic-numbersstrings
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 note
471bf0c
to
5d6c42a
Compare
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @maximpn |
FYI, here's an ER for adding support for tag exclusion since it looks like we didn't have one open already 🙂 |
…lastic#149508) **Relates to**: elastic#140263 ## Summary This PR migrates custom tags selector implementation on the rules page which mimics EuiSelectable to **EuiSelectable**. Besides simplification it brings keyboard and accessibility support as well as simplifies accessing the component in e2e tests. *Before:* https://user-images.githubusercontent.com/3775283/214831542-737aa9cf-8f76-4777-a23f-cbbfe0a01825.mov *After:* https://user-images.githubusercontent.com/3775283/214831568-e0809fd7-3c17-4789-8d3a-9ecbe379fb56.mov ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
Relates to: #140263
Summary
This PR migrates custom tags selector implementation on the rules page which mimics EuiSelectable to EuiSelectable. Besides simplification it brings keyboard and accessibility support as well as simplifies accessing the component in e2e tests.
Before:
Screen.Recording.2023-01-26.at.12.56.22.mov
After:
Screen.Recording.2023-01-26.at.13.05.55.mov
Checklist