Skip to content

Commit

Permalink
[8.16] [Security Solution][Document Flyout] Fix toggle column missing…
Browse files Browse the repository at this point in the history
… in timeline (#200647) (#200661)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Security Solution][Document Flyout] Fix toggle column missing in
timeline (#200647)](#200647)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"christineweng","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-18T23:44:43Z","message":"[Security
Solution][Document Flyout] Fix toggle column missing in timeline
(#200647)\n\n## Summary\r\n\r\nRelated:
https://github.com/elastic/kibana/issues/200046\r\n\r\nReenabling toggle
columns for events. It was mistakenly excluded
in\r\n[this\r\nrefactor](https://github.com/elastic/kibana/pull/190560/files#diff-d9edcdb9ad0f231269f791e8392d2d0fe1d10105c223c89d9f86e546972bc342)\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e787c227-f167-4f3a-a0e0-d1ac1ad45670)","sha":"467d7370ad5eafda73a8a6ff39deb29709ade5ae","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:fix","v9.0.0","Team:Threat
Hunting","Team:Threat
Hunting:Investigations","v8.17.0","v8.16.1"],"title":"[Security
Solution][Document Flyout] Fix toggle column missing in
timeline","number":200647,"url":"https://github.com/elastic/kibana/pull/200647","mergeCommit":{"message":"[Security
Solution][Document Flyout] Fix toggle column missing in timeline
(#200647)\n\n## Summary\r\n\r\nRelated:
https://github.com/elastic/kibana/issues/200046\r\n\r\nReenabling toggle
columns for events. It was mistakenly excluded
in\r\n[this\r\nrefactor](https://github.com/elastic/kibana/pull/190560/files#diff-d9edcdb9ad0f231269f791e8392d2d0fe1d10105c223c89d9f86e546972bc342)\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e787c227-f167-4f3a-a0e0-d1ac1ad45670)","sha":"467d7370ad5eafda73a8a6ff39deb29709ade5ae"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200647","number":200647,"mergeCommit":{"message":"[Security
Solution][Document Flyout] Fix toggle column missing in timeline
(#200647)\n\n## Summary\r\n\r\nRelated:
https://github.com/elastic/kibana/issues/200046\r\n\r\nReenabling toggle
columns for events. It was mistakenly excluded
in\r\n[this\r\nrefactor](https://github.com/elastic/kibana/pull/190560/files#diff-d9edcdb9ad0f231269f791e8392d2d0fe1d10105c223c89d9f86e546972bc342)\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e787c227-f167-4f3a-a0e0-d1ac1ad45670)","sha":"467d7370ad5eafda73a8a6ff39deb29709ade5ae"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: christineweng <[email protected]>
  • Loading branch information
kibanamachine and christineweng authored Nov 19, 2024
1 parent b900fa0 commit f3f9ac9
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 { useDocumentDetailsContext } from '../context';
import { getSourcererScopeId } from '../../../../helpers';
import { useBasicDataFromDetailsData } from '../hooks/use_basic_data_from_details_data';
import { SecurityCellActionType } from '../../../../app/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 } = useDocumentDetailsContext();
const { isAlert } = useBasicDataFromDetailsData(dataFormattedForFieldBrowser);

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

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_DOWN}
triggerId={triggerId}
triggerId={SecurityCellActionsTrigger.DETAILS_FLYOUT}
visibleCellActions={6}
sourcererScopeId={getSourcererScopeId(scopeId)}
metadata={metadata}
Expand Down

0 comments on commit f3f9ac9

Please sign in to comment.