Skip to content

Commit

Permalink
[8.15] [Security Solution][Alert details] - do not show Notes tab for…
Browse files Browse the repository at this point in the history
… Rule creation preview alerts (#187966) (#188048)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Security Solution][Alert details] - do not show Notes tab for Rule
creation preview alerts
(#187966)](#187966)

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

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

<!--BACKPORT [{"author":{"name":"Philippe
Oberti","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-11T06:27:30Z","message":"[Security
Solution][Alert details] - do not show Notes tab for Rule creation
preview alerts
(#187966)","sha":"cc7588c8cb9cc428e97df6b057a898fa7ceb5383","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting:Investigations","v8.15.0","v8.16.0"],"title":"[Security
Solution][Alert details] - do not show Notes tab for Rule creation
preview
alerts","number":187966,"url":"https://github.com/elastic/kibana/pull/187966","mergeCommit":{"message":"[Security
Solution][Alert details] - do not show Notes tab for Rule creation
preview alerts
(#187966)","sha":"cc7588c8cb9cc428e97df6b057a898fa7ceb5383"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/187966","number":187966,"mergeCommit":{"message":"[Security
Solution][Alert details] - do not show Notes tab for Rule creation
preview alerts
(#187966)","sha":"cc7588c8cb9cc428e97df6b057a898fa7ceb5383"}}]}]
BACKPORT-->

Co-authored-by: Philippe Oberti <[email protected]>
  • Loading branch information
kibanamachine and PhilippeOberti authored Jul 11, 2024
1 parent 494668e commit 0684662
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const LeftPanelNotesTab: LeftPanelPaths = 'notes';
export const LeftPanel: FC<Partial<DocumentDetailsProps>> = memo(({ path }) => {
const { telemetry } = useKibana().services;
const { openLeftPanel } = useExpandableFlyoutApi();
const { eventId, indexName, scopeId, getFieldsData } = useDocumentDetailsContext();
const { eventId, indexName, scopeId, getFieldsData, isPreview } = useDocumentDetailsContext();
const eventKind = getField(getFieldsData('event.kind'));
const securitySolutionNotesEnabled = useIsExperimentalFeatureEnabled(
'securitySolutionNotesEnabled'
Expand All @@ -43,11 +43,11 @@ export const LeftPanel: FC<Partial<DocumentDetailsProps>> = memo(({ path }) => {
eventKind === EventKind.signal
? [tabs.insightsTab, tabs.investigationTab, tabs.responseTab]
: [tabs.insightsTab];
if (securitySolutionNotesEnabled) {
if (securitySolutionNotesEnabled && !isPreview) {
tabList.push(tabs.notesTab);
}
return tabList;
}, [eventKind, securitySolutionNotesEnabled]);
}, [eventKind, isPreview, securitySolutionNotesEnabled]);

const selectedTabId = useMemo(() => {
const defaultTab = tabsDisplayed[0].id;
Expand Down

0 comments on commit 0684662

Please sign in to comment.