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] Handle lens actions in Serverless #163581

Merged
merged 23 commits into from
Aug 14, 2023

Conversation

js-jankisalvi
Copy link
Contributor

@js-jankisalvi js-jankisalvi commented Aug 10, 2023

Summary

fixes #160126

This PR

  • hides owner selection while adding lens to case from dashboard for observability and securitySolution serverless
  • hides add to new case and add to existing case lens action for Elasticsearch serverless

How to test

  • Run Observability/Securtiy solution serverless project and add lens visualization to case from dashboard
  • Run ES serverless project and check that lens do not have option to add to case
  • Classic kibana works as before (check dashboard from securitySolution and generic dashboard as well)

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@js-jankisalvi js-jankisalvi added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature release_note:feature Makes this part of the condensed release notes v8.10.0 labels Aug 10, 2023
@js-jankisalvi js-jankisalvi requested a review from a team as a code owner August 10, 2023 10:40
@js-jankisalvi js-jankisalvi self-assigned this Aug 10, 2023
@js-jankisalvi js-jankisalvi requested a review from a team as a code owner August 10, 2023 10:40
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@adcoelho
Copy link
Contributor

Tested a bunch of scenarios:

  • Serverless
    • Observability:
      • Does not display owner selection
      • Creates the case without errors
      • Created case has 'observability' as owner
    • Security Solution:
      • Does not display owner selection
      • Creates the case without errors
      • Created case has 'securitySolution' as owner
    • Stack:
      • Hides the options add to new case and add to existing case
  • Classic Kibana
    • Still works as expected 👍

const availableOwners = useAvailableCasesOwners();
const canShowCaseSolutionSelection = !owner.length && availableOwners.length;
const canShowCaseSolutionSelection = !owner.length && availableOwners.length > 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this will slightly change the behavior of the form when going through Analytics in Classic Kibana.

There there is no owner and the availableOwners can be 1(depending on the role's permissions). This will make it not show the owner picker(your PR) vs showing the owner picker with all options disabled except one(main).

It is a specific scenario so maybe it is not a problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm..The only way to handle this could be to add another config variable which tells weather it is serverless or classic kibana and then put the check accordingly.

However I think it's okay to not show owner selector picker when only one owner because we don't show it anyway when it's a security solution dashboard and user has permission for cases in security in classic kibana.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah but there we don't show because we are in Security Solution. The owner is defined and it is safe to assume the created case will end up inside Security Solution.

In the scenario I mentioned, we start from Analytics. The user has no indication of where the case will end up.

(Although he can assume if he only has access to like, Observability 😄 )

I think this is minor though. Maybe double-check with @mdefazio ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm good with hiding this if there is only one solution available. Thanks for double checking on this. @shanisagiv1 Let me know if you're ok with hiding this solution selector (and if you would like some more context to this, happy to zoom 😉 )

Copy link
Contributor

@adcoelho adcoelho left a comment

Choose a reason for hiding this comment

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

Good stuff 👌

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

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
cases 421.7KB 421.7KB +59.0B

History

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

cc @js-jankisalvi

@js-jankisalvi js-jankisalvi merged commit ebfb832 into elastic:main Aug 14, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Aug 14, 2023
@js-jankisalvi js-jankisalvi deleted the hide-lens-actions-serverless branch February 19, 2024 11:52
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:feature Makes this part of the condensed release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cases] Lens actions in Serverless
9 participants