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 Solutions] Fix CellActions component should hide ShowTopN action for nested fields #159645

Merged

Conversation

machadoum
Copy link
Member

@machadoum machadoum commented Jun 14, 2023

issue: #150347

Summary

CellActions component should hide ShowTopN action for nested fields because Lens doesn't support it.

  • Add validations to exclude field that are not supported by Lens

After:
Screenshot 2023-06-30 at 14 26 09

How to test

  • Go to Security Solutions Alerts page
  • Add Endpoint.policy.applied.artifacts.global.identifiers.name field
  • Check if ShowTopN is displayed

Checklist

Delete any items that are not applicable to this PR.

@machadoum machadoum self-assigned this Jun 21, 2023
@machadoum machadoum force-pushed the siem-explore-cell-actions-150347-bugfix branch from 0d1c325 to 8078521 Compare June 30, 2023 09:55
@machadoum machadoum changed the title Siem explore cell actions 150347 bugfix [Security Solutions] Fix CellActions component should hide ShowTopN action for nested fields Jun 30, 2023
@machadoum machadoum added release_note:fix Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore labels Jun 30, 2023
@machadoum machadoum force-pushed the siem-explore-cell-actions-150347-bugfix branch 2 times, most recently from 36093d5 to 4e9233e Compare June 30, 2023 12:38
@machadoum machadoum force-pushed the siem-explore-cell-actions-150347-bugfix branch from 4e9233e to caab209 Compare July 3, 2023 07:23
@machadoum machadoum marked this pull request as ready for review July 3, 2023 11:21
@machadoum machadoum requested a review from a team as a code owner July 3, 2023 11:21
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

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

Comment on lines 40 to 48
const SUPPORTED_LENS_TYPES = new Set([
KBN_FIELD_TYPES.STRING,
KBN_FIELD_TYPES.BOOLEAN,
KBN_FIELD_TYPES.NUMBER,
KBN_FIELD_TYPES.IP,
]);

export const isLensSupportedType = (fieldType: string | undefined) =>
fieldType ? SUPPORTED_LENS_TYPES.has(fieldType as KBN_FIELD_TYPES) : false;
Copy link
Contributor

Choose a reason for hiding this comment

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

The isLensSupportedType is only used by showTopN cellAction, it should not be defined as a common util function. Can we move it to the showTopN action file that uses it?

Also, it is a bit confusing having isLensEmbeddable util function used by all lensActions, and the isLensSupportedType which is not used by lensActions, in the same place.

Copy link
Member Author

@machadoum machadoum Jul 3, 2023

Choose a reason for hiding this comment

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

Good catch! I moved it from public/actions/utils to public/common/utils/lens because I found out that detection had implemented the same function.

@machadoum machadoum requested a review from a team as a code owner July 3, 2023 12:22
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 4240 4241 +1

Async chunks

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

id before after diff
securitySolution 11.0MB 11.0MB +354.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 410 414 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 489 493 +4
total +6

History

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

cc @machadoum

@machadoum machadoum enabled auto-merge (squash) July 4, 2023 14:20
@machadoum machadoum merged commit 7be72ef into elastic:main Jul 5, 2023
@kibanamachine kibanamachine added v8.10.0 backport:skip This commit does not require backporting labels Jul 5, 2023
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jul 5, 2023
* main: (354 commits)
  [Synthetics] Overview page fix last refresh value display (elastic#161086)
  [Synthetics] Remove TLS alert option for ICMP monitor (elastic#161173)
  fixing the path of manifets for hints autodiscover (elastic#161075)
  [Fleet] Fix permissions in integrations Assets page (elastic#161233)
  Update publicBaseUrl warning id (elastic#161204)
  [ML] Fix Anomaly Explorer URL for alerting context with non-default space  (elastic#160899)
  [Enterprise Search]Add 404 error handling for mappings and documents endpoints (elastic#161203)
  [Logs Shared] Move LogStream and LogView into new shared plugin (elastic#161151)
  [Security Solutions] Fix  CellActions component should hide ShowTopN action for nested fields (elastic#159645)
  [SecuritySolutions] Remove filter actions from Cases alerts table and fix show_top_n action (elastic#161150)
  [Infrastructure UI] Add strict payload validation to inventory_views endpoint (elastic#160852)
  [api-docs] 2023-07-05 Daily api_docs build (elastic#161225)
  Fix errors in custom metric payload in SLO dev docs (elastic#161141)
  [data views] Fix overwrite param for create (elastic#160953)
  [Synthetics] Perform params API HTTP migration (elastic#160575)
  [Cloud Security][FTR]Refactor API FTR to use .to.eql instead of .to.be  (elastic#160694)
  Have SLO routes return a 403 instead of a 400 when user has an insufficient license (elastic#161193)
  [Discover] Fix shared links flaky test (elastic#161172)
  [ftr] Improve FTR error handling for NoSuchSessionError (elastic#161025)
  skip flaky suite (elastic#151981)
  ...
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jul 5, 2023
* main: (354 commits)
  [Synthetics] Overview page fix last refresh value display (elastic#161086)
  [Synthetics] Remove TLS alert option for ICMP monitor (elastic#161173)
  fixing the path of manifets for hints autodiscover (elastic#161075)
  [Fleet] Fix permissions in integrations Assets page (elastic#161233)
  Update publicBaseUrl warning id (elastic#161204)
  [ML] Fix Anomaly Explorer URL for alerting context with non-default space  (elastic#160899)
  [Enterprise Search]Add 404 error handling for mappings and documents endpoints (elastic#161203)
  [Logs Shared] Move LogStream and LogView into new shared plugin (elastic#161151)
  [Security Solutions] Fix  CellActions component should hide ShowTopN action for nested fields (elastic#159645)
  [SecuritySolutions] Remove filter actions from Cases alerts table and fix show_top_n action (elastic#161150)
  [Infrastructure UI] Add strict payload validation to inventory_views endpoint (elastic#160852)
  [api-docs] 2023-07-05 Daily api_docs build (elastic#161225)
  Fix errors in custom metric payload in SLO dev docs (elastic#161141)
  [data views] Fix overwrite param for create (elastic#160953)
  [Synthetics] Perform params API HTTP migration (elastic#160575)
  [Cloud Security][FTR]Refactor API FTR to use .to.eql instead of .to.be  (elastic#160694)
  Have SLO routes return a 403 instead of a 400 when user has an insufficient license (elastic#161193)
  [Discover] Fix shared links flaky test (elastic#161172)
  [ftr] Improve FTR error handling for NoSuchSessionError (elastic#161025)
  skip flaky suite (elastic#151981)
  ...
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 release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants