-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Observability] Remove outdated top_alerts route and related types #107579
Changes from 9 commits
7f8d440
a6f2c40
6bf826a
de546f2
3a22b8f
564b740
c0c794e
8ccbead
2917b5e
76c6964
78a7b2f
29d9a16
c88d4cd
f9965c5
def6987
a1267b1
492378c
714020a
0d60ce7
9475988
d66a474
77631aa
4bbb744
ad01a55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,16 +31,16 @@ import { | |
} from '@kbn/rule-data-utils/target/technical_field_names'; | ||
import moment from 'moment-timezone'; | ||
import React, { useMemo } from 'react'; | ||
import type { TopAlert, TopAlertResponse } from '../'; | ||
import type { TopAlert } from '../'; | ||
import { useKibana, useUiSetting } from '../../../../../../../src/plugins/kibana_react/public'; | ||
import { asDuration } from '../../../../common/utils/formatters'; | ||
import type { ObservabilityRuleTypeRegistry } from '../../../rules/create_observability_rule_type_registry'; | ||
import { decorateResponse } from '../decorate_response'; | ||
import { parseAlert } from '../parse_alert'; | ||
import { SeverityBadge } from '../severity_badge'; | ||
|
||
type AlertsFlyoutProps = { | ||
alert?: TopAlert; | ||
alerts?: TopAlertResponse[]; | ||
alerts?: Array<Record<string, unknown>>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even if we don't have much type safety now, would it make sense to extract |
||
isInApp?: boolean; | ||
observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry; | ||
selectedAlertId?: string; | ||
|
@@ -59,7 +59,8 @@ export function AlertsFlyout({ | |
const { http } = services; | ||
const prepend = http?.basePath.prepend; | ||
const decoratedAlerts = useMemo(() => { | ||
return decorateResponse(alerts ?? [], observabilityRuleTypeRegistry); | ||
const parseObservabilityAlert = parseAlert(observabilityRuleTypeRegistry); | ||
return (alerts ?? []).map(parseObservabilityAlert); | ||
}, [alerts, observabilityRuleTypeRegistry]); | ||
|
||
let alertData = alert; | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this doesn't fix the story but it also doesn't break it further. But IMHO it would exceed the scope of the PR to implement a working t-grid mock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the story isn't doing doing anything we should just delete it.