[Security Solution][Detections] Simplify file download flow #101571
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
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):
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).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)ExportTimeline
componentExportTimeline
component reacts to its prop change withuseEffect
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 imperativedownloadBlob
method.Original discussion: #100554 (comment)
The text was updated successfully, but these errors were encountered: