Skip to content

Commit fe79c85

Browse files
[Security Solution] [Notes] Enable templated insights with all events, not just alerts (elastic#197164)
## Summary Currently all notes that make use of the markdown based timeline data providers will render as a timeline template if the note is associated with an event, and not an alert. Mostly everything is in place to have everything work for both already, there's just no context that contains the event document in the tree in the notes list component currently. This pr adds that context, and everything else works as expected. ![event_insights](https://github.com/user-attachments/assets/72d25ef2-0c2c-4f82-974f-0f005c9b2d77) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
1 parent dcd8e0c commit fe79c85

File tree

1 file changed

+8
-2
lines changed
  • x-pack/plugins/security_solution/public/flyout/document_details/left/components

1 file changed

+8
-2
lines changed

x-pack/plugins/security_solution/public/flyout/document_details/left/components/notes_details.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import {
3333
import { useDocumentDetailsContext } from '../../shared/context';
3434
import { useUserPrivileges } from '../../../../common/components/user_privileges';
3535
import { useWhichFlyout } from '../../shared/hooks/use_which_flyout';
36+
import { BasicAlertDataContext } from './investigation_guide_view';
37+
import { useInvestigationGuide } from '../../shared/hooks/use_investigation_guide';
3638

3739
export const FETCH_NOTES_ERROR = i18n.translate(
3840
'xpack.securitySolution.flyout.left.notes.fetchNotesErrorLabel',
@@ -55,6 +57,10 @@ export const NotesDetails = memo(() => {
5557
const dispatch = useDispatch();
5658
const { eventId, dataFormattedForFieldBrowser } = useDocumentDetailsContext();
5759
const { kibanaSecuritySolutionsPrivileges } = useUserPrivileges();
60+
const { basicAlertData: basicData } = useInvestigationGuide({
61+
dataFormattedForFieldBrowser,
62+
});
63+
5864
const canCreateNotes = kibanaSecuritySolutionsPrivileges.crud;
5965

6066
// will drive the value we send to the AddNote component
@@ -130,7 +136,7 @@ export const NotesDetails = memo(() => {
130136
);
131137

132138
return (
133-
<>
139+
<BasicAlertDataContext.Provider value={basicData}>
134140
{fetchStatus === ReqStatus.Loading && (
135141
<EuiLoadingElastic data-test-subj={NOTES_LOADING_TEST_ID} size="xxl" />
136142
)}
@@ -156,7 +162,7 @@ export const NotesDetails = memo(() => {
156162
</AddNote>
157163
</>
158164
)}
159-
</>
165+
</BasicAlertDataContext.Provider>
160166
);
161167
});
162168

0 commit comments

Comments
 (0)