Skip to content

Commit

Permalink
[Security Solution][Details Flyout] Enable toggle column action in ev…
Browse files Browse the repository at this point in the history
…ent flyout (#181755)

## Summary

Address #181552. Toggle column
was previously disabled for non-alerts, enabling in this PR.


![image](https://github.com/elastic/kibana/assets/18648970/7f4dcf8f-8290-4423-8a31-2d4e7e351342)

**How to test**

- Enable feature flag `expandableEventFlyoutEnabled`
- Generate some events and go to Host/User, event table
- Expand on a row with session view
- Hover actions (in table or highlighted fields) should have toggle
column action
  • Loading branch information
christineweng committed Apr 25, 2024
1 parent ee1552f commit 725b9bf
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type { FC } from 'react';
import React, { useMemo } from 'react';
import { useRightPanelContext } from '../context';
import { getSourcererScopeId } from '../../../../helpers';
import { useBasicDataFromDetailsData } from '../../../../timelines/components/side_panel/event_details/helpers';
import { SecurityCellActionType } from '../../../../actions/constants';
import {
CellActionsMode,
Expand Down Expand Up @@ -40,12 +39,7 @@ interface CellActionsProps {
* Security cell action wrapper for document details flyout
*/
export const CellActions: FC<CellActionsProps> = ({ field, value, isObjectArray, children }) => {
const { dataFormattedForFieldBrowser, scopeId, isPreview } = useRightPanelContext();
const { isAlert } = useBasicDataFromDetailsData(dataFormattedForFieldBrowser);

const triggerId = isAlert
? SecurityCellActionsTrigger.DETAILS_FLYOUT
: SecurityCellActionsTrigger.DEFAULT;
const { scopeId, isPreview } = useRightPanelContext();

const data = useMemo(() => ({ field, value }), [field, value]);
const metadata = useMemo(() => ({ scopeId, isObjectArray }), [scopeId, isObjectArray]);
Expand All @@ -58,7 +52,7 @@ export const CellActions: FC<CellActionsProps> = ({ field, value, isObjectArray,
<SecurityCellActions
data={data}
mode={CellActionsMode.HOVER_RIGHT}
triggerId={triggerId}
triggerId={SecurityCellActionsTrigger.DETAILS_FLYOUT}
visibleCellActions={6}
sourcererScopeId={getSourcererScopeId(scopeId)}
metadata={metadata}
Expand Down

0 comments on commit 725b9bf

Please sign in to comment.