mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
Rename getEditAlertFlyout to getEditRuleFlyout (#153243)
This commit is contained in:
parent
8abf46f216
commit
d762a2a6bb
12 changed files with 19 additions and 19 deletions
|
@ -55,7 +55,7 @@ export const MlAnomalyAlertFlyout: FC<MlAnomalyAlertFlyoutProps> = ({
|
|||
};
|
||||
|
||||
if (initialAlert) {
|
||||
return triggersActionsUi.getEditAlertFlyout({
|
||||
return triggersActionsUi.getEditRuleFlyout({
|
||||
...commonProps,
|
||||
initialRule: {
|
||||
...initialAlert,
|
||||
|
|
|
@ -85,7 +85,7 @@ export const AlertConfiguration: React.FC<Props> = (props: Props) => {
|
|||
const flyoutUi = useMemo(
|
||||
() =>
|
||||
showFlyout &&
|
||||
Legacy.shims.triggersActionsUi.getEditAlertFlyout({
|
||||
Legacy.shims.triggersActionsUi.getEditRuleFlyout({
|
||||
initialRule: {
|
||||
...alert,
|
||||
ruleTypeId: alert.alertTypeId,
|
||||
|
|
|
@ -33,8 +33,8 @@ const triggersActionsUiStartMock = {
|
|||
<div data-test-subj="alerts-state-table">mocked component</div>
|
||||
)),
|
||||
getAddRuleFlyout: jest.fn(() => <div data-test-subj="add-rule-flyout">mocked component</div>),
|
||||
getEditAlertFlyout: jest.fn(() => (
|
||||
<div data-test-subj="edit-alert-flyout">mocked component</div>
|
||||
getEditRuleFlyout: jest.fn(() => (
|
||||
<div data-test-subj="edit-rule-flyout">mocked component</div>
|
||||
)),
|
||||
getRuleAlertsSummary: jest.fn(() => (
|
||||
<div data-test-subj="rule-alerts-summary">mocked component</div>
|
||||
|
|
|
@ -28,7 +28,7 @@ export function HeaderActions({ alert }: HeaderActionsProps) {
|
|||
cases: {
|
||||
hooks: { getUseCasesAddToExistingCaseModal },
|
||||
},
|
||||
triggersActionsUi: { getEditAlertFlyout: EditRuleFlyout, getRuleSnoozeModal: RuleSnoozeModal },
|
||||
triggersActionsUi: { getEditRuleFlyout: EditRuleFlyout, getRuleSnoozeModal: RuleSnoozeModal },
|
||||
} = useKibana<ObservabilityAppServices>().services;
|
||||
|
||||
const { rule, reloadRule } = useFetchRule({
|
||||
|
|
|
@ -76,7 +76,7 @@ export function RuleDetailsPage() {
|
|||
triggersActionsUi: {
|
||||
alertsTableConfigurationRegistry,
|
||||
ruleTypeRegistry,
|
||||
getEditAlertFlyout: EditAlertFlyout,
|
||||
getEditRuleFlyout: EditRuleFlyout,
|
||||
getRuleEventLogList,
|
||||
getAlertsStateTable: AlertsStateTable,
|
||||
getAlertSummaryWidget: AlertSummaryWidget,
|
||||
|
@ -424,7 +424,7 @@ export function RuleDetailsPage() {
|
|||
}}
|
||||
/>
|
||||
{editFlyoutVisible && (
|
||||
<EditAlertFlyout
|
||||
<EditRuleFlyout
|
||||
initialRule={rule}
|
||||
onClose={() => {
|
||||
setEditFlyoutVisible(false);
|
||||
|
|
|
@ -37,7 +37,7 @@ export const useSyntheticsAlert = (isOpen: boolean) => {
|
|||
if (!alert) {
|
||||
return null;
|
||||
}
|
||||
return triggersActionsUi.getEditAlertFlyout({
|
||||
return triggersActionsUi.getEditRuleFlyout({
|
||||
onClose: () => dispatch(setAlertFlyoutVisible(false)),
|
||||
initialRule: alert,
|
||||
});
|
||||
|
|
|
@ -32,7 +32,7 @@ export const UptimeEditAlertFlyoutComponent = ({
|
|||
|
||||
const EditAlertFlyout = useMemo(
|
||||
() =>
|
||||
triggersActionsUi.getEditAlertFlyout({
|
||||
triggersActionsUi.getEditRuleFlyout({
|
||||
initialRule: initialAlert,
|
||||
onClose: () => {
|
||||
setAlertFlyoutVisibility(false);
|
||||
|
|
|
@ -30,7 +30,7 @@ describe('ML Integrations', () => {
|
|||
it('renders without errors', () => {
|
||||
const wrapper = renderWithRouter(
|
||||
<KibanaContextProvider
|
||||
services={{ ...core, triggersActionsUi: { getEditAlertFlyout: jest.fn() } }}
|
||||
services={{ ...core, triggersActionsUi: { getEditRuleFlyout: jest.fn() } }}
|
||||
>
|
||||
<MLIntegrationComponent />
|
||||
</KibanaContextProvider>
|
||||
|
|
|
@ -44,7 +44,7 @@ export const TransformAlertFlyout: FC<TransformAlertFlyoutProps> = ({
|
|||
};
|
||||
|
||||
if (initialAlert) {
|
||||
return triggersActionsUi.getEditAlertFlyout({
|
||||
return triggersActionsUi.getEditRuleFlyout({
|
||||
...commonProps,
|
||||
initialRule: {
|
||||
...initialAlert,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ConnectorProvider } from '../application/context/connector_context';
|
|||
import { RuleEdit } from '../application/sections/rule_form';
|
||||
import type { ConnectorServices, RuleEditProps as AlertEditProps } from '../types';
|
||||
|
||||
export const getEditAlertFlyoutLazy = (
|
||||
export const getEditRuleFlyoutLazy = (
|
||||
props: AlertEditProps & { connectorServices: ConnectorServices }
|
||||
) => {
|
||||
return (
|
|
@ -10,7 +10,7 @@ import type { TriggersAndActionsUIPublicPluginStart } from './plugin';
|
|||
import { getAddConnectorFlyoutLazy } from './common/get_add_connector_flyout';
|
||||
import { getEditConnectorFlyoutLazy } from './common/get_edit_connector_flyout';
|
||||
import { getAddRuleFlyoutLazy } from './common/get_add_rule_flyout';
|
||||
import { getEditAlertFlyoutLazy } from './common/get_edit_alert_flyout';
|
||||
import { getEditRuleFlyoutLazy } from './common/get_edit_rule_flyout';
|
||||
import { TypeRegistry } from './application/type_registry';
|
||||
import {
|
||||
ActionTypeModel,
|
||||
|
@ -78,8 +78,8 @@ function createStartMock(): TriggersAndActionsUIPublicPluginStart {
|
|||
connectorServices,
|
||||
});
|
||||
},
|
||||
getEditAlertFlyout: (props: Omit<RuleEditProps, 'actionTypeRegistry' | 'ruleTypeRegistry'>) => {
|
||||
return getEditAlertFlyoutLazy({
|
||||
getEditRuleFlyout: (props: Omit<RuleEditProps, 'actionTypeRegistry' | 'ruleTypeRegistry'>) => {
|
||||
return getEditRuleFlyoutLazy({
|
||||
...props,
|
||||
actionTypeRegistry,
|
||||
ruleTypeRegistry,
|
||||
|
|
|
@ -30,7 +30,7 @@ import { TypeRegistry } from './application/type_registry';
|
|||
import { getAddConnectorFlyoutLazy } from './common/get_add_connector_flyout';
|
||||
import { getEditConnectorFlyoutLazy } from './common/get_edit_connector_flyout';
|
||||
import { getAddRuleFlyoutLazy } from './common/get_add_rule_flyout';
|
||||
import { getEditAlertFlyoutLazy } from './common/get_edit_alert_flyout';
|
||||
import { getEditRuleFlyoutLazy } from './common/get_edit_rule_flyout';
|
||||
import { getAlertsTableLazy } from './common/get_alerts_table';
|
||||
import { getFieldBrowserLazy } from './common/get_field_browser';
|
||||
import { getRuleStatusDropdownLazy } from './common/get_rule_status_dropdown';
|
||||
|
@ -108,7 +108,7 @@ export interface TriggersAndActionsUIPublicPluginStart {
|
|||
getAddRuleFlyout: (
|
||||
props: Omit<RuleAddProps, 'actionTypeRegistry' | 'ruleTypeRegistry'>
|
||||
) => ReactElement<RuleAddProps>;
|
||||
getEditAlertFlyout: (
|
||||
getEditRuleFlyout: (
|
||||
props: Omit<RuleEditProps, 'actionTypeRegistry' | 'ruleTypeRegistry'>
|
||||
) => ReactElement<RuleEditProps>;
|
||||
getAlertsTable: (props: AlertsTableProps) => ReactElement<AlertsTableProps>;
|
||||
|
@ -374,10 +374,10 @@ export class Plugin
|
|||
connectorServices: this.connectorServices!,
|
||||
});
|
||||
},
|
||||
getEditAlertFlyout: (
|
||||
getEditRuleFlyout: (
|
||||
props: Omit<RuleEditProps, 'actionTypeRegistry' | 'ruleTypeRegistry'>
|
||||
) => {
|
||||
return getEditAlertFlyoutLazy({
|
||||
return getEditRuleFlyoutLazy({
|
||||
...props,
|
||||
actionTypeRegistry: this.actionTypeRegistry,
|
||||
ruleTypeRegistry: this.ruleTypeRegistry,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue