-
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.
feat(rca): add header details (#193600)
- Loading branch information
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