Skip to content

Commit

Permalink
Enable templated insights with all events, not just alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
kqualters-elastic committed Oct 22, 2024
1 parent 7fb2b0f commit 8ac8022
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import {
import { useDocumentDetailsContext } from '../../shared/context';
import { useUserPrivileges } from '../../../../common/components/user_privileges';
import { useWhichFlyout } from '../../shared/hooks/use_which_flyout';
import { BasicAlertDataContext } from './investigation_guide_view';
import { useInvestigationGuide } from '../../shared/hooks/use_investigation_guide';

export const FETCH_NOTES_ERROR = i18n.translate(
'xpack.securitySolution.flyout.left.notes.fetchNotesErrorLabel',
Expand All @@ -55,6 +57,10 @@ export const NotesDetails = memo(() => {
const dispatch = useDispatch();
const { eventId, dataFormattedForFieldBrowser } = useDocumentDetailsContext();
const { kibanaSecuritySolutionsPrivileges } = useUserPrivileges();
const { basicAlertData: basicData } = useInvestigationGuide({
dataFormattedForFieldBrowser,
});

const canCreateNotes = kibanaSecuritySolutionsPrivileges.crud;

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

return (
<>
<BasicAlertDataContext.Provider value={basicData}>
{fetchStatus === ReqStatus.Loading && (
<EuiLoadingElastic data-test-subj={NOTES_LOADING_TEST_ID} size="xxl" />
)}
Expand All @@ -156,7 +162,7 @@ export const NotesDetails = memo(() => {
</AddNote>
</>
)}
</>
</BasicAlertDataContext.Provider>
);
});

Expand Down

0 comments on commit 8ac8022

Please sign in to comment.