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 Solution][Detections] Simplify file download flow #101571

Open
xcrzx opened this issue Jun 8, 2021 · 2 comments
Open

[Security Solution][Detections] Simplify file download flow #101571

xcrzx opened this issue Jun 8, 2021 · 2 comments
Labels
Team:Detection Engine Security Solution Detection Engine Area Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. technical debt Improvement of the software architecture and operational architecture

Comments

@xcrzx
Copy link
Contributor

xcrzx commented Jun 8, 2021

Currently, the file download process is unnecessarily complicated from a developer's perspective and includes some redundant steps.

Let's look at the timeline download process, for example. It includes the following steps (simplified):

  1. A user clicks Export, and the process kicks off with the download handler (https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_batch_actions.tsx).
  2. The download handler calls setState under the hood and sets a bool flag indicating that the download started (https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_actions.tsx)
  3. The bool flag gets prop drilled down to the ExportTimeline component
  4. The ExportTimeline component reacts to its prop change with useEffect and starts downloading (x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/export_timeline.tsx)

We can remove state (steps 2 and 3) from the process by downloading files imperatively as soon as the user clicks Export. We also don't need to have the <ExportTimeline /> component and use an imperative downloadBlob method.

Original discussion: #100554 (comment)

@xcrzx xcrzx added technical debt Improvement of the software architecture and operational architecture Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. labels Jun 8, 2021
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@peluja1012 peluja1012 added Team:Security Solution Platform Security Solution Platform Team Team:Detection Rule Management Security Detection Rule Management Team labels Oct 22, 2021
@yctercero yctercero added Team:Detection Engine Security Solution Detection Engine Area and removed Team:Security Solution Platform Security Solution Platform Team labels May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Detection Engine Security Solution Detection Engine Area Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

No branches or pull requests

4 participants