-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Backport This will backport the following commits from `main` to `8.x`: - [feat(rca): add header details (#193600)](#193600) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kevin Delemme","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-20T16:34:23Z","message":"feat(rca): add header details (#193600)","sha":"0b1bf2727b565c5dc1b824c9b076e6bc0514f2a9","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management","v8.16.0"],"title":"feat(rca): add header details","number":193600,"url":"https://github.com/elastic/kibana/pull/193600","mergeCommit":{"message":"feat(rca): add header details (#193600)","sha":"0b1bf2727b565c5dc1b824c9b076e6bc0514f2a9"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193600","number":193600,"mergeCommit":{"message":"feat(rca): add header details (#193600)","sha":"0b1bf2727b565c5dc1b824c9b076e6bc0514f2a9"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Kevin Delemme <[email protected]>
- Loading branch information
1 parent
9c641cb
commit 6b4524f
Showing
6 changed files
with
118 additions
and
35 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...bility_solution/investigate_app/public/components/investigation_tag/investigation_tag.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiFlexItem, EuiBadge } from '@elastic/eui'; | ||
import React from 'react'; | ||
|
||
interface Props { | ||
tag: string; | ||
} | ||
|
||
export function InvestigationTag({ tag }: Props) { | ||
return ( | ||
<EuiFlexItem grow={false}> | ||
<EuiBadge color="hollow">{tag}</EuiBadge> | ||
</EuiFlexItem> | ||
); | ||
} |
41 changes: 41 additions & 0 deletions
41
...stigate_app/public/pages/details/components/investigation_header/alert_details_button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiButtonEmpty, EuiText } from '@elastic/eui'; | ||
import { alertOriginSchema } from '@kbn/investigation-shared'; | ||
import { ALERT_RULE_CATEGORY } from '@kbn/rule-registry-plugin/common/technical_rule_data_field_names'; | ||
import React from 'react'; | ||
import { useKibana } from '../../../../hooks/use_kibana'; | ||
import { useInvestigation } from '../../contexts/investigation_context'; | ||
import { useFetchAlert } from '../../hooks/use_fetch_alert'; | ||
|
||
export function AlertDetailsButton() { | ||
const { | ||
core: { | ||
http: { basePath }, | ||
}, | ||
} = useKibana(); | ||
const { investigation } = useInvestigation(); | ||
|
||
const alertOriginInvestigation = alertOriginSchema.safeParse(investigation?.origin); | ||
const alertId = alertOriginInvestigation.success ? alertOriginInvestigation.data.id : undefined; | ||
const { data: alertDetails } = useFetchAlert({ id: alertId }); | ||
|
||
if (!alertDetails) { | ||
return null; | ||
} | ||
return ( | ||
<EuiButtonEmpty | ||
data-test-subj="investigationDetailsAlertLink" | ||
iconType="arrowLeft" | ||
size="xs" | ||
href={basePath.prepend(`/app/observability/alerts/${alertId}`)} | ||
> | ||
<EuiText size="s">{`[Alert] ${alertDetails?.[ALERT_RULE_CATEGORY]} breached`}</EuiText> | ||
</EuiButtonEmpty> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters