-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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][Tech Debt] Decoupled TGrid state part from Timelines under the security_solution store #141010
[Security Solution][Tech Debt] Decoupled TGrid state part from Timelines under the security_solution store #141010
Conversation
…nes under the security_solution store
…m/YulNaumenko/kibana into security-solution-tgrid-own-state # Conflicts: # x-pack/plugins/security_solution/public/timelines/store/data_table/selectors.ts
…defining the scopeId
…m/YulNaumenko/kibana into security-solution-tgrid-own-state # Conflicts: # x-pack/plugins/security_solution/public/common/components/hover_actions/use_hover_action_items.tsx
…grid-own-state # Conflicts: # x-pack/plugins/security_solution/public/common/components/event_details/cti_details/threat_summary_view.tsx # x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx # x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/register_alerts_table_configuration.tsx # x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx # x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx # x-pack/plugins/security_solution/public/detections/components/osquery/osquery_flyout.tsx # x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/preview_histogram.tsx # x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx # x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx # x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx # x-pack/plugins/security_solution/public/timelines/components/fields_browser/index.tsx # x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/expandable_event.tsx # x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/index.tsx # x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.tsx # x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.tsx # x-pack/plugins/security_solution/public/users/pages/details/index.tsx # x-pack/plugins/timelines/public/components/t_grid/helpers.tsx # x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx # x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx
…grid-own-state # Conflicts: # x-pack/plugins/security_solution/public/common/components/sessions_viewer/index.tsx
…ailsPage TableId.detectionsPage -> TableId.alertsOnAlertsPage
…e' into security-solution-tgrid-own-state
}; | ||
|
||
/** | ||
* Migrates the values of the data table from the legacy timelines key to the securityDataTable key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌🏾
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sync size changes/limits.yml LGTM. I was advised to leave the async bundles out of scope for the operations review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making these changes! Did clickthrough testing for the tables including the detail flyouts, hover action functionality, and column persistence. It all looks to be working as expected! Thanks, LGTM!
…grid-own-state # Conflicts: # x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @YulNaumenko |
…nes under the security_solution store (elastic#141010) * [Security Solution][Tech Debt] Decoupled TGrid state part from Timelines under the security_solution store * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Unified usage of data table get by id selector * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Cleanup - removed not used code * - * - * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Fixed add to timeline * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Fixed filter manager for useHoverActions by proper context usage for defining the scopeId * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Fixed es lint * - * TableIds to TableId * Fixed unit tests * Fixed tests * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * - * fixed garphevent component * FIxed details tests * Added mock for cases test * Fixed store tests * fixed mocks * fixed mocks * Cleaned up tgrid store from the timeline actions * Set back reduceReducers to handle ability addToTimelineButton, need to change this later when timelines data will live in the timeline plugin * fixed merge * fixed check types * Fixed type checks * Fixed tests * Added snapshot * Fixed toggleDetails for user and host * fixed tests * Fixed timelines tests * FIxed tests * Fixed tests * Fixed tests * Fixed Jest tests * Fixed resolver bug * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * FIxed miissing filterManager * moved tgrid store * Reduced bundle size! * Fixed names * Fixed tests * Removed test * New securitySolution bundle size * Cleanup the store * More cleanup * Removed footer * removed excludedRowRendererIds * Fixed typecheck * remove tests changes * Cleaned up unused selectors * Removed savedObjectId from tgrid state * fixed type check * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Resolved the comments * Fixed due to comments * Fixed type checks * Fixed tests * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * fixed merge issue * Move suricata-sid-db to lazy loaded modules * Fixed test * moved mitre helpers to async chunk * Fixed due to comments * Fixed tests * Renamed TableId.detectionsRulesDetailsPage -> TableId.alertsOnRuleDetailsPage TableId.detectionsPage -> TableId.alertsOnAlertsPage * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Fixed typecheck * Fixed test Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Resolves #143153
This was not initially in the scope, but this PR contains the changes, which allows to reduce the bundle size of the
security_solution
plugin:Before changes
After
The bundle size reduce was met by moving
getSubPluginRoutesByCapabilities
andmanageOldSiemRoutes
to the lazy loaded chunk.Both functions are used after the application mounted, so shouldn't stop the
security_solution
plugin to load.The actual theme of the PR is about the changes in the
security_solution
store related to splitting the logic for timelines and data tables.New security solution redux store structure.
New TGrid redux store structure.
Removed fields which is not used by TGrid:TableId
enum and reduceTimelineId
to keep only timelines:storageTimelines?: Pick<TimelineState, 'timelineById'>;
tostorageDataTables?: Pick<TableState, 'tableById'>;
, because we store only the data tables info about the user settings changes.New local storage structure for the data table
Fo actions:
This changes is applied to the next list of the hooks and components:
EventFieldsBrowser
,useAlertsActions
,AddressLinksItemComponent
,GraphOverlayComponent
,UseDetailPanelReturn
,DetailsPanel
,HeaderActionsComponent
,ActionsComponent
Only data table selector and actions is used for
PreviewHistogram
,HostDetailsComponent
,HostsComponent
,HostsTabs
,SessionsView
,NetworkComponent
reduceReducers
to manageaddProviderToTimeline
logic which is not movable for now tosecurity_solution
plugin. This is the specific part of the timeline data store management in security_solution plugin from the timelines plugin, which is used by other plugins asto avoid the circular dependancies (particularly for
osquery
plugin, because this is not a sub plugin forsecurity_solution
and no way to use the store and security context like we did forthreat_intelligence
plugin).To make it at least better organized, moved addProviderToTimeline action to the new timeline folder under the
x-pack/plugins/timelines/public/store
.Exposed the reducer from the timeline plugin interface:
and combined this to manage the timeline part of the security_solution store.
EventsQueryTabBodyComponent
to update the dataTable store:from
to
tableDefaults
for the dataTableTGridModel
x-pack/plugins/timelines/public/store/t_grid
x-pack/plugins/security_solution/public/timelines/store/timeline
timelineId
toscopeId
for the nextinterfaces
CellValueElementProps
EnrichedFieldInfo
components
DetailsPanel
BarChartComponent
DraggableLegendItemComponent
DraggableWrapperComponent
DefaultDraggable
AlertSummaryView
EnrichmentDescription
EnrichmentSummary
Overview
EventDetailsComponent
RelatedAlertsByProcessAncestry
Insights
RelatedAlertsBySession
RelatedAlertsBySourceEvent
Overview
StatusPopoverButton
ActionCell
PrevalenceCell
SummaryValueCell
EventsQueryTabBody
ShowTopNButton
HoverActions
MatrixHistogramComponent
SessionsViewComponent
StatefulTopNComponent
TopNComponent
UseAlertPrevalence
ExpandedCellValueActionsComponent
FieldValueCell
AlertsTableComponent
PreviewTableCellRenderer
PreviewRenderCellValue
TakeActionDropdown
RenderCellValue
DefaultCellRenderer
DetectionEnginePageComponent
RuleDetailsPageComponent
EventsQueryTabBody
EventsByDatasetComponent
DraggableWrapper
ExpandableEvent
FlyoutBodyComponent
FlyoutFooterComponent
EventDetailsPanelComponent