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

[Cases] Filter & paginate cases activity #140096

Closed
9 tasks done
cnasikas opened this issue Sep 6, 2022 · 4 comments
Closed
9 tasks done

[Cases] Filter & paginate cases activity #140096

cnasikas opened this issue Sep 6, 2022 · 4 comments
Assignees
Labels
Feature:Cases Cases feature Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.7.0 v8.8.0

Comments

@cnasikas
Copy link
Member

cnasikas commented Sep 6, 2022

Cases show the activity (user actions) of the case. At the moment, we fetch all users' actions and show them in the case's activity. To aid users to find quicker information related to a case we should a) allow filtering the activity list based on the type of activity (alerts, user comments, etc) and b) support pagination. To achieve that we need to create API endpoints that support filtering and pagination on comments and user actions.

Cases UI gets the fields of the connectors from the user actions. It traverses through all user actions to find the fields of the selected information and indicates to the user if the case needs to be pushed. By introducing filtering and pagination the UI cannot deduct the needed information about connectors. For that reason, we need to provide the information needed by the UI on the backend. An internal endpoint should be created that returns all fields of all connectors attached to the case plus if the case needs to be pushed.

Task items

Related issues: #130227, #134346, #134344, #115730, #117904, #149191

@cnasikas cnasikas added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature labels Sep 6, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@cnasikas cnasikas changed the title [Cases] Filter cases activity [Cases] Filter and paginate cases activity Nov 16, 2022
@js-jankisalvi js-jankisalvi changed the title [Cases] Filter and paginate cases activity [Cases] Filter cases activity Dec 20, 2022
@cnasikas cnasikas changed the title [Cases] Filter cases activity [Cases] Filter & paginate cases activity Jan 19, 2023
@jonathan-buttner
Copy link
Contributor

jonathan-buttner commented Jan 23, 2023

@cnasikas for the bulk get attachments, should it allow retrieving attachments from multiple cases in a single request? I doubt we'd use it in the UI any time soon but it's trivial to support that functionality.

Also how about:

POST /internal/cases/attachments/_bulk_get

Using a post so we can support retrieving 10k attachments in one go and attachments to keep inline with the bulk create.

@cnasikas
Copy link
Member Author

cnasikas commented Jan 24, 2023

Hmm interesting, my initial thought was to be per case like the _find. For example, POST /internal/cases/<case_id>/attachments/_bulk_get (I forgot to update the description. Sorry for that). It is easier to do validations/authorization per case and very trivial to change to support all documents later. If it was a public one what would you do?

Using a post so we can support retrieving 10k attachments in one go and attachments to keep inline with the bulk create.

Good catch!

@jonathan-buttner
Copy link
Contributor

Following up here, we talked as a team and we're going to go with only retrieving the comments for a particular case for now and expand it in the future if we need to.

js-jankisalvi added a commit that referenced this issue Feb 23, 2023
## Summary

This PR adds filter and sort options for filtering user activities on
Cases view.
You can filter by `All`, `Comments` and `History` options. You can sort
by `ascending` or `descending` options.

Issue: #140096,
#149191


https://user-images.githubusercontent.com/117571355/220635598-9805a984-7015-41ca-bc9c-50baaa773113.mov

**Took below decisions to not overcomplicate this PR**

- Use the `EuiCommentList` at the moment for `Description` component and
remove it/improve it in future PR
- Put the `Description` component inside the left section of Activity
tab to show description and Sidebar section together

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [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] 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)

### Flakey test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1928

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release notes

Adds filtering and sorting for the case activity.

---------

Co-authored-by: kibanamachine <[email protected]>
@cnasikas cnasikas closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Cases Cases feature Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.7.0 v8.8.0
Projects
None yet
Development

No branches or pull requests

5 participants