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
[Cases] Cases Table: Configure Available Filters Including Custom Fields #172276
Conversation
Meta #167651 ### Description Part 1/3. This PR brings no updates to the UI but refactors the `status` and `severity` filters to allow multi selection. ### QA - Filters should work the same as before - But in the local storage, status and severity filters are now stored as an array instead of a string (be aware that current users will have status and severity stored as strings the first time they enter the case list page) - _find API should throw no error when status or severity have more than one value #### Example: Status in-progress or open, severity medium or low <pre> curl --location 'http://localhost:5601/api/cases/_find?owner=observability&sortField=title&sortOrder=desc&status=in-progress&status=open&severity=medium&severity=low' \ --header 'kbn-xsrf: true' \ --header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' </pre> --------- Co-authored-by: Antonio <antoniodcoelho@gmail.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Meta #167651 ### Description Part 2/3. This PR refactors the filters to be multi select <img width="829" alt="Screenshot" src="https://github.com/elastic/kibana/assets/17549662/5b0efe3f-f4a0-423e-9d64-0dfa50e74ce6"> ### QA - Filters work as multi select now - 'All' has been removed as option for status and severity. Check that old urls, local storage values do not break anything - Review the cases list in the modal when adding a timeline to a case --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Antonio <antoniodcoelho@gmail.com>
Meta #167651 Refactors the Solution Filter to use the same component as the rest of the filters ![Screenshot](https://github.com/elastic/kibana/assets/17549662/df506f77-edb8-4fd7-ae2f-cb6b04b7ff29) ## QA Add `Sample web logs` data and click on `View Data` > `ML Jobs` ![Screenshot](https://github.com/elastic/kibana/assets/17549662/8540be39-45bb-4307-a4a6-bbeef382f0aa) Then on the `3 dots right side` of the `Anomaly timeline` > `Add to case` > `Overall`
…171102) Meta issue: #167651 ## Summary We need to make a small update to our multi select component. Right now, it only allows options with labels, but for custom fields, we might have situations where different fields have the same label. So, we're going to adjust it to work with options that have both {key, label}. For our system filters (status, category, severity, ...) we'll keep using the label as the key. This is important because it helps us maintain our current way of handling the global state of our filters without any issues ## QA An exhaustive QA is not required for this PR, as it's only going into a feature branch. The filters should continue working
Meta issue: #167651 ## Summary https://github.com/elastic/kibana/assets/17549662/b0fc9464-8cac-4547-8a85-aac24cf941e9 ## What this PR does not include (will be done in future PRs) - If the users adds to many filters, the UI will overflow - If the url contains status or severity set and the filter is not active, we need to automatically activate that filter and set the filter option ## useEffect situation We tried to remove some useEffects, specifically in [useFilterConfig](https://github.com/elastic/kibana/pull/171176/files#diff-3e3d844f888b4030bd3f3ead9e71866757a6d9ff7e5d3972afebed9956fcddceR62) and [useSystemFilterConfig](https://github.com/elastic/kibana/pull/171176/files#diff-2696d6c860ec0b34363c060d2638f2b63698f06128d1155f735f34de7cc5b5b3R200) but as they have dependencies that are loaded from API's, there are some use cases, like if a new custom field is added or removed where effects (I think) are a must. We will come back to this issue once we have the feature in main to try to solve this issue --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/creation.cy.ts
Show resolved
Hide resolved
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.
Security code LGTM
x-pack/test/security_solution_cypress/cypress/e2e/explore/cases/creation.cy.ts
Show resolved
Hide resolved
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
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.
I tested and everything is working as expected (including migrating from main to your branch) except the ones in the description. I found a small bug. In the solution filter if you try to click all of the options you cannot click a third filter. It does not matter which one.
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.
Amazing work 🚀 🎉
I tested below scenarios and they are working as expected:
- Multiple filter selection including custom fields
- filter config behaviour in URL and local storage
- Having old values in the local storage
- active filter behaviour in URL and local storage
- Selector view - found same bug as Christos mentioned regarding the solution filter
Found small UI issue:
When customField label is too long or there are more number of custom fields selected in the filter config, the more
button is not accessible.
Maybe we can move only more
button in next line in this case?
Thanks Janki, we will fix it when fixing the overflow issue. Don't know yet how to solve it. |
Meta issue #167651
Fixes: #167651
Summary
Previous PRs merged into this feature branch:
Release notes
Case list filter bar can now be customised. Filters can be removed and custom fields can be used as filters
Pending issues
Flaky test runner link
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4128