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] Bulk edit assignees #146907

Merged
merged 28 commits into from
Dec 23, 2022
Merged

[Cases] Bulk edit assignees #146907

merged 28 commits into from
Dec 23, 2022

Conversation

cnasikas
Copy link
Member

@cnasikas cnasikas commented Dec 2, 2022

Summary

This PR adds the ability to bulk edit assignees on multiple cases. Because the tags and the assignees share common logic:

  • I create the useIsUserTyping hook which contains common logic for when the user is typing. Is meant to be used with debouncing functions
  • I extracted all common logic from the tags selectable about state and rendering and put it in two new hooks called useItemsAction and useItemsState. No logic was changed in the state management
  • I refactored the tag action to use the new common hooks
bulk_edit_assignees.mov

Checklist

Delete any items that are not applicable to this PR.

For maintainers

Release notes

Add the ability to bulk edit assignees on multiple cases

@cnasikas cnasikas added release_note:enhancement Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature v8.7.0 labels Dec 2, 2022
@cnasikas cnasikas marked this pull request as ready for review December 13, 2022 17:59
@cnasikas cnasikas requested a review from a team as a code owner December 13, 2022 17:59
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

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

@cnasikas cnasikas self-assigned this Dec 13, 2022
@cnasikas cnasikas force-pushed the bulk_edit_assignees branch from d676ef6 to 9bf0b69 Compare December 13, 2022 18:00
@cnasikas
Copy link
Member Author

@elasticmachine merge upstream

@peteharverson
Copy link
Contributor

peteharverson commented Dec 15, 2022

Without the suggestions functionality, I don't think it is very obvious that you have to start typing something to see a list of users you can assign a case to.

With no assignees:
image

And here it looks like all I can do is remove the currently assigned user.

image

It would be nice if we could get the same UX as from the View case page, where you see a list of users before typing anything:

image

If that isn't possible, I think we need some help text on the flyout, saying something like Enter search text to see a list of users to assign this case to

Any thoughts @mdefazio ?

@peteharverson
Copy link
Contributor

Would be nice to have some quick way of removing all assignees, as we have in the case view - edit assignees popover, and we also have in the Bulk edit of tags flyout.

image

@cnasikas
Copy link
Member Author

@mdefazio We discuss it with @peteharverson offline and we decide to not do any changes expect improving labels, search placeholders, and adding a message when the selected assignees do not have any assignees. We can improve it later when we introduce suggestions.

@adcoelho
Copy link
Contributor

I am having some weird behavior with the suggested users:

Screen.Recording.2022-12-15.at.16.11.09.mov

Additionally, is this expected?

Screen.Recording.2022-12-15.at.16.15.35.mov

Find it a bit weird that if I clear the search and we display Selected: 1 the deselected user still shows up.

@cnasikas
Copy link
Member Author

@peteharverson I update the placeholder text and show a message when there are no assignees in the selected cases. I also added the "Remove all assignees" functionality.

Screenshot 2022-12-21 at 12 51 10 PM

Screenshot 2022-12-21 at 12 50 32 PM

@adcoelho For the first scenario, this also happens in the popover on the view case page. It is happening because if the search results are already added in the selectable the EUI will perform a search in the list as you type. In the meanwhile, we are fetching new results based on what you typed. ES searches differently and does not return the same. I can explain better offline if you like. If you think it is a bug we should fix could you please open an issue so we can fix it on another PR?

For the second scenario, yes it is expected. Same as the tags, from the initial assignees you need to know which are the one you are removing.

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested latest changes and other than one minor comment, LGTM

Copy link
Contributor

@js-jankisalvi js-jankisalvi left a comment

Choose a reason for hiding this comment

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

Tested locally, LGTM. Amazing work 🚀

@cnasikas cnasikas enabled auto-merge (squash) December 22, 2022 13:11
@cnasikas
Copy link
Member Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
cases 518 527 +9

Async chunks

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

id before after diff
cases 349.8KB 360.2KB +10.4KB
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 61 67 +6
osquery 109 115 +6
securitySolution 436 442 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 70 76 +6
osquery 110 117 +7
securitySolution 512 518 +6
total +21

History

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

cc @cnasikas

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:Cases Cases feature release_note:enhancement Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants