Skip to content
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

Merged
merged 9 commits into from
Jan 27, 2023

Conversation

maximpn
Copy link
Contributor

@maximpn maximpn commented Jan 25, 2023

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

@maximpn maximpn added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Feature:Rule Management Security Solution Detection Rule Management area Team:Detection Rule Management Security Detection Rule Management Team v8.7.0 labels Jan 25, 2023
@maximpn maximpn self-assigned this Jan 25, 2023
@maximpn maximpn marked this pull request as ready for review January 26, 2023 09:46
@maximpn maximpn requested review from a team as code owners January 26, 2023 09:46
@maximpn maximpn requested a review from spong January 26, 2023 09:46
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@maximpn maximpn force-pushed the update-tags-to-eui-selectable branch from 9810f80 to 471bf0c Compare January 26, 2023 12:07
Copy link
Member

@spong spong left a 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! 🚀

Comment on lines 93 to 96
searchProps={{
placeholder: 'Search tags',
}}
aria-label="Rules tag search"
Copy link
Member

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 }}>
Copy link
Contributor

@vitaliidm vitaliidm Jan 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good note

@maximpn maximpn force-pushed the update-tags-to-eui-selectable branch from 471bf0c to 5d6c42a Compare January 27, 2023 12:48
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #48 / dashboard elements dashboard elements Controls Options list control Interactions between options list and dashboard Test data view runtime field "after all" hook for "making selection has expected results"
  • [job] [logs] FTR Configs #48 / dashboard elements dashboard elements Controls Options list control Interactions between options list and dashboard Test data view runtime field can create options list control on runtime field
  • [job] [logs] FTR Configs #48 / dashboard elements dashboard elements Controls Options list control Interactions between options list and dashboard Test data view runtime field making selection has expected results
  • [job] [logs] FTR Configs #48 / dashboard elements dashboard elements Controls Options list control Interactions between options list and dashboard Test data view runtime field new control has expected suggestions
  • [job] [logs] Security Solution Tests #3 / Timelines Creates a timeline by clicking untitled timeline from bottom bar can be added notes

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 12.8MB 12.8MB +762.0B

History

  • 💚 Build #102927 succeeded 471bf0c19e6d8f891949a69e24dd9fb4b878bdae
  • 💛 Build #102783 was flaky 5a92fcae6ea9d8f12d27689778045886909d7dd0
  • 💔 Build #102622 failed 5fdfc1702cbdf8976ae26b18c4497d47e4e04049
  • 💔 Build #102581 failed 122d0a4d588aead78f8179a500d642f8dcc56039

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @maximpn

@spong
Copy link
Member

spong commented Jan 27, 2023

FYI, here's an ER for adding support for tag exclusion since it looks like we didn't have one open already 🙂

#149708

kqualters-elastic pushed a commit to kqualters-elastic/kibana that referenced this pull request Feb 6, 2023
…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)
@maximpn maximpn deleted the update-tags-to-eui-selectable branch February 24, 2023 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Rule Management Security Solution Detection Rule Management area release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants