diff --git a/x-pack/plugins/alerting/common/rule.ts b/x-pack/plugins/alerting/common/rule.ts index 980dccf632f6b8e..0bac3fd995a2792 100644 --- a/x-pack/plugins/alerting/common/rule.ts +++ b/x-pack/plugins/alerting/common/rule.ts @@ -77,6 +77,12 @@ export interface RuleExecutionStatus { export type RuleActionParams = SavedObjectAttributes; export type RuleActionParam = SavedObjectAttribute; +export interface RuleActionFrequency extends SavedObjectAttributes { + summary: boolean; + notifyWhen: RuleNotifyWhenType; + throttle: string | null; +} + export type IsoWeekday = 1 | 2 | 3 | 4 | 5 | 6 | 7; export interface AlertsFilterTimeframe extends SavedObjectAttributes { days: IsoWeekday[]; @@ -103,11 +109,7 @@ export interface RuleAction { id: string; actionTypeId: string; params: RuleActionParams; - frequency?: { - summary: boolean; - notifyWhen: RuleNotifyWhenType; - throttle: string | null; - }; + frequency?: RuleActionFrequency; alertsFilter?: AlertsFilter; } diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx index 591e3518af8d732..02566a8302937b0 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx @@ -6,23 +6,79 @@ */ import { isEmpty } from 'lodash/fp'; -import { EuiSpacer, EuiCallOut } from '@elastic/eui'; +import { EuiSpacer, EuiCallOut, EuiText } from '@elastic/eui'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import deepMerge from 'deepmerge'; import ReactMarkdown from 'react-markdown'; import styled from 'styled-components'; -import type { ActionVariables } from '@kbn/triggers-actions-ui-plugin/public'; +import type { + ActionVariables, + NotifyWhenSelectOptions, +} from '@kbn/triggers-actions-ui-plugin/public'; +import { RuleNotifyWhen } from '@kbn/alerting-plugin/common'; import type { RuleAction, RuleActionAlertsFilterProperty, RuleActionParam, } from '@kbn/alerting-plugin/common'; import { SecurityConnectorFeatureId } from '@kbn/actions-plugin/common'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { FieldHook } from '../../../../shared_imports'; import { useFormContext } from '../../../../shared_imports'; import { useKibana } from '../../../../common/lib/kibana'; -import { FORM_ERRORS_TITLE } from './translations'; +import { + FORM_CUSTOM_FREQUENCY_OPTION, + FORM_ERRORS_TITLE, + FORM_ON_ACTIVE_ALERT_OPTION, +} from './translations'; + +const DEFAULT_FREQUENCY = { + notifyWhen: RuleNotifyWhen.ACTIVE, + throttle: null, + summary: true, +}; + +const NOTIFY_WHEN_OPTIONS: NotifyWhenSelectOptions[] = [ + { + isSummaryOption: true, + isForEachAlertOption: true, + value: { + value: 'onActiveAlert', + inputDisplay: FORM_ON_ACTIVE_ALERT_OPTION, + 'data-test-subj': 'onActiveAlert', + dropdownDisplay: ( + +

+ +

+
+ ), + }, + }, + { + isSummaryOption: true, + isForEachAlertOption: false, + value: { + value: 'onThrottleInterval', + inputDisplay: FORM_CUSTOM_FREQUENCY_OPTION, + 'data-test-subj': 'onThrottleInterval', + dropdownDisplay: ( + +

+ +

+
+ ), + }, + }, +]; interface Props { field: FieldHook; @@ -165,8 +221,12 @@ export const RuleActionsField: React.FC = ({ field, messageVariables }) = setActionAlertsFilterProperty, featureId: SecurityConnectorFeatureId, defaultActionMessage: DEFAULT_ACTION_MESSAGE, + defaultSummaryMessage: DEFAULT_ACTION_MESSAGE, hideActionHeader: true, hideNotifyWhen: true, + hasSummary: true, + notifyWhenSelectOptions: NOTIFY_WHEN_OPTIONS, + defaultRuleFrequency: DEFAULT_FREQUENCY, showActionAlertsFilter: true, }), [ diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/translations.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/translations.tsx index e0e44afb98de36b..ca2deb524223e7d 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/translations.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/translations.tsx @@ -13,3 +13,17 @@ export const FORM_ERRORS_TITLE = i18n.translate( defaultMessage: 'Please fix issues listed below', } ); + +export const FORM_ON_ACTIVE_ALERT_OPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleNotifyWhen.onActiveAlert.display', + { + defaultMessage: 'Per rule run', + } +); + +export const FORM_CUSTOM_FREQUENCY_OPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleNotifyWhen.onThrottleInterval.display', + { + defaultMessage: 'Custom frequency', + } +); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx index 0a8d2d7cd88f921..6b7ede2f0174723 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx @@ -22,6 +22,7 @@ import { import { ActionGroup, RuleActionAlertsFilterProperty, + RuleActionFrequency, RuleActionParam, } from '@kbn/alerting-plugin/common'; import { betaBadgeProps } from './beta_badge_props'; @@ -33,6 +34,7 @@ import { ActionConnector, ActionVariables, ActionTypeRegistryContract, + NotifyWhenSelectOptions, } from '../../../types'; import { SectionLoading } from '../../components/section_loading'; import { ActionTypeForm } from './action_type_form'; @@ -77,6 +79,8 @@ export interface ActionAccordionFormProps { defaultSummaryMessage?: string; hasSummary?: boolean; minimumThrottleInterval?: [number | undefined, string]; + notifyWhenSelectOptions?: NotifyWhenSelectOptions[]; + defaultRuleFrequency?: RuleActionFrequency; showActionAlertsFilter?: boolean; } @@ -108,6 +112,8 @@ export const ActionForm = ({ defaultSummaryMessage, hasSummary, minimumThrottleInterval, + notifyWhenSelectOptions, + defaultRuleFrequency = DEFAULT_FREQUENCY, showActionAlertsFilter, }: ActionAccordionFormProps) => { const { @@ -232,7 +238,7 @@ export const ActionForm = ({ actionTypeId: actionTypeModel.id, group: defaultActionGroupId, params: {}, - frequency: DEFAULT_FREQUENCY, + frequency: defaultRuleFrequency, }); setActionIdByIndex(actionTypeConnectors[0].id, actions.length - 1); } @@ -244,7 +250,7 @@ export const ActionForm = ({ actionTypeId: actionTypeModel.id, group: defaultActionGroupId, params: {}, - frequency: DEFAULT_FREQUENCY, + frequency: defaultRuleFrequency, }); setActionIdByIndex(actions.length.toString(), actions.length - 1); setEmptyActionsIds([...emptyActionsIds, actions.length.toString()]); @@ -415,6 +421,8 @@ export const ActionForm = ({ defaultSummaryMessage={defaultSummaryMessage} hasSummary={hasSummary} minimumThrottleInterval={minimumThrottleInterval} + notifyWhenSelectOptions={notifyWhenSelectOptions} + defaultNotifyWhenValue={defaultRuleFrequency.notifyWhen} showActionAlertsFilter={showActionAlertsFilter} /> ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_notify_when.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_notify_when.tsx index 5295fcc08131dd8..27750dc0bfe61c7 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_notify_when.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_notify_when.tsx @@ -19,7 +19,6 @@ import { EuiText, EuiSpacer, EuiSuperSelect, - EuiSuperSelectOption, EuiPopover, EuiButtonEmpty, EuiContextMenuPanel, @@ -28,93 +27,105 @@ import { import { some, filter, map } from 'fp-ts/lib/Option'; import { pipe } from 'fp-ts/lib/pipeable'; import { getTimeOptions } from '../../../common/lib/get_time_options'; -import { RuleNotifyWhenType, RuleAction } from '../../../types'; +import { RuleNotifyWhenType, RuleAction, NotifyWhenSelectOptions } from '../../../types'; import { DEFAULT_FREQUENCY } from '../../../common/constants'; -export const NOTIFY_WHEN_OPTIONS: Array> = [ +export const NOTIFY_WHEN_OPTIONS: NotifyWhenSelectOptions[] = [ { - value: 'onActionGroupChange', - inputDisplay: i18n.translate( - 'xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.display', - { - defaultMessage: 'On status changes', - } - ), - 'data-test-subj': 'onActionGroupChange', - dropdownDisplay: ( - <> - - - - -

+ isSummaryOption: false, + isForEachAlertOption: true, + value: { + value: 'onActionGroupChange', + inputDisplay: i18n.translate( + 'xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.display', + { + defaultMessage: 'On status changes', + } + ), + 'data-test-subj': 'onActionGroupChange', + dropdownDisplay: ( + <> + -

-
- - ), + + +

+ +

+
+ + ), + }, }, { - value: 'onActiveAlert', - inputDisplay: i18n.translate( - 'xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.display', - { - defaultMessage: 'On check intervals', - } - ), - 'data-test-subj': 'onActiveAlert', - dropdownDisplay: ( - <> - - - - -

+ isSummaryOption: true, + isForEachAlertOption: true, + value: { + value: 'onActiveAlert', + inputDisplay: i18n.translate( + 'xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.display', + { + defaultMessage: 'On check intervals', + } + ), + 'data-test-subj': 'onActiveAlert', + dropdownDisplay: ( + <> + -

-
- - ), + + +

+ +

+
+ + ), + }, }, { - value: 'onThrottleInterval', - inputDisplay: i18n.translate( - 'xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.display', - { - defaultMessage: 'On custom action intervals', - } - ), - 'data-test-subj': 'onThrottleInterval', - dropdownDisplay: ( - <> - - - - -

+ isSummaryOption: true, + isForEachAlertOption: true, + value: { + value: 'onThrottleInterval', + inputDisplay: i18n.translate( + 'xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.display', + { + defaultMessage: 'On custom action intervals', + } + ), + 'data-test-subj': 'onThrottleInterval', + dropdownDisplay: ( + <> + -

-
- - ), + + +

+ +

+
+ + ), + }, }, ]; @@ -128,6 +139,8 @@ interface ActionNotifyWhenProps { hasSummary?: boolean; showMinimumThrottleWarning?: boolean; showMinimumThrottleUnitWarning?: boolean; + notifyWhenSelectOptions?: NotifyWhenSelectOptions[]; + defaultNotifyWhenValue?: RuleNotifyWhenType; } export const ActionNotifyWhen = ({ @@ -140,11 +153,12 @@ export const ActionNotifyWhen = ({ onSummaryChange, showMinimumThrottleWarning, showMinimumThrottleUnitWarning, + notifyWhenSelectOptions = NOTIFY_WHEN_OPTIONS, + defaultNotifyWhenValue = DEFAULT_FREQUENCY.notifyWhen, }: ActionNotifyWhenProps) => { const [showCustomThrottleOpts, setShowCustomThrottleOpts] = useState(false); - const [notifyWhenValue, setNotifyWhenValue] = useState( - DEFAULT_FREQUENCY.notifyWhen - ); + const [notifyWhenValue, setNotifyWhenValue] = + useState(defaultNotifyWhenValue); const [summaryMenuOpen, setSummaryMenuOpen] = useState(false); @@ -179,15 +193,53 @@ export const ActionNotifyWhen = ({ [onNotifyWhenChange, onThrottleChange, throttle, throttleUnit] ); + const summaryNotifyWhenOptions = useMemo( + () => notifyWhenSelectOptions.filter((o) => o.isSummaryOption).map((o) => o.value), + [notifyWhenSelectOptions] + ); + + const forEachAlertNotifyWhenOptions = useMemo( + () => notifyWhenSelectOptions.filter((o) => o.isForEachAlertOption).map((o) => o.value), + [notifyWhenSelectOptions] + ); + + const notifyWhenOptions = useMemo( + () => (frequency.summary ? summaryNotifyWhenOptions : forEachAlertNotifyWhenOptions), + [forEachAlertNotifyWhenOptions, frequency.summary, summaryNotifyWhenOptions] + ); + + const selectedOptionDoesNotExist = useCallback( + (summary: boolean) => + (summary && + !summaryNotifyWhenOptions.filter((o) => o.value === frequency.notifyWhen).length) || + (!summary && + !forEachAlertNotifyWhenOptions.filter((o) => o.value === frequency.notifyWhen).length), + [forEachAlertNotifyWhenOptions, frequency.notifyWhen, summaryNotifyWhenOptions] + ); + + const getDefaultNotifyWhenOption = useCallback( + (summary: boolean) => { + if (summary) { + return summaryNotifyWhenOptions.length + ? summaryNotifyWhenOptions[0].value + : RuleNotifyWhen.ACTIVE; + } + return forEachAlertNotifyWhenOptions.length + ? forEachAlertNotifyWhenOptions[0].value + : RuleNotifyWhen.ACTIVE; + }, + [forEachAlertNotifyWhenOptions, summaryNotifyWhenOptions] + ); + const selectSummaryOption = useCallback( (summary: boolean) => { onSummaryChange(summary); setSummaryMenuOpen(false); - if (summary && frequency.notifyWhen === RuleNotifyWhen.CHANGE) { - onNotifyWhenChange(RuleNotifyWhen.ACTIVE); + if (selectedOptionDoesNotExist(summary)) { + onNotifyWhenChange(getDefaultNotifyWhenOption(summary)); } }, - [onSummaryChange, frequency.notifyWhen, onNotifyWhenChange] + [onSummaryChange, selectedOptionDoesNotExist, onNotifyWhenChange, getDefaultNotifyWhenOption] ); const summaryOptions = useMemo( @@ -198,6 +250,7 @@ export const ActionNotifyWhen = ({ onClick={() => selectSummaryOption(true)} icon={frequency.summary ? 'check' : 'empty'} id="actionNotifyWhen-option-summary" + data-test-subj="actionNotifyWhen-option-summary" > {SUMMARY_OF_ALERTS} , @@ -207,6 +260,7 @@ export const ActionNotifyWhen = ({ onClick={() => selectSummaryOption(false)} icon={!frequency.summary ? 'check' : 'empty'} id="actionNotifyWhen-option-for_each" + data-test-subj="actionNotifyWhen-option-for_each" > {FOR_EACH_ALERT} , @@ -242,14 +296,6 @@ export const ActionNotifyWhen = ({ ); - const notifyWhenOptions = useMemo( - () => - frequency.summary - ? NOTIFY_WHEN_OPTIONS.filter((o) => o.value !== RuleNotifyWhen.CHANGE) - : NOTIFY_WHEN_OPTIONS, - [frequency.summary] - ); - return ( {'Per rule run'}, + }, + }, + { + isSummaryOption: true, + isForEachAlertOption: false, + value: { + value: 'onThrottleInterval', + inputDisplay: 'Custom frequency', + 'data-test-subj': 'onThrottleInterval', + dropdownDisplay: <>{'Custom frequency'}, + }, + }, +]; const actionTypeRegistry = actionTypeRegistryMock.create(); @@ -367,6 +391,116 @@ describe('action_type_form', () => { ], ]); }); + + describe('Customize notify when options', () => { + it('should not have "On status changes" notify when option for summary actions', async () => { + const actionType = actionTypeRegistryMock.createMockActionTypeModel({ + id: '.pagerduty', + iconClass: 'test', + selectMessage: 'test', + validateParams: (): Promise> => { + const validationResult = { errors: {} }; + return Promise.resolve(validationResult); + }, + actionConnectorFields: null, + actionParamsFields: mockedActionParamsFields, + defaultActionParams: { + dedupKey: 'test', + eventAction: 'resolve', + }, + }); + actionTypeRegistry.get.mockReturnValue(actionType); + const actionItem = { + id: '123', + actionTypeId: '.pagerduty', + group: 'default', + params: {}, + frequency: { + notifyWhen: RuleNotifyWhen.ACTIVE, + throttle: null, + summary: true, + }, + }; + const wrapper = render( + + {getActionTypeForm({ + index: 1, + actionItem, + notifyWhenSelectOptions: CUSTOM_NOTIFY_WHEN_OPTIONS, + defaultNotifyWhenValue: RuleNotifyWhen.ACTIVE, + })} + + ); + + wrapper.getByTestId('notifyWhenSelect').click(); + await act(async () => { + expect(wrapper.queryByText('On status changes')).not.toBeTruthy(); + expect(wrapper.queryByText('On check intervals')).not.toBeTruthy(); + expect(wrapper.queryByText('On custom action intervals')).not.toBeTruthy(); + + expect(wrapper.getAllByText('Per rule run')).toBeTruthy(); + expect(wrapper.getAllByText('Custom frequency')).toBeTruthy(); + + expect(wrapper.queryByTestId('onActionGroupChange')).not.toBeTruthy(); + expect(wrapper.getByTestId('onActiveAlert')).toBeTruthy(); + expect(wrapper.getByTestId('onThrottleInterval')).toBeTruthy(); + }); + }); + + it('should have only "Per rule run" notify when option for "For each alert" actions', async () => { + const actionType = actionTypeRegistryMock.createMockActionTypeModel({ + id: '.pagerduty', + iconClass: 'test', + selectMessage: 'test', + validateParams: (): Promise> => { + const validationResult = { errors: {} }; + return Promise.resolve(validationResult); + }, + actionConnectorFields: null, + actionParamsFields: mockedActionParamsFields, + defaultActionParams: { + dedupKey: 'test', + eventAction: 'resolve', + }, + }); + actionTypeRegistry.get.mockReturnValue(actionType); + const actionItem = { + id: '123', + actionTypeId: '.pagerduty', + group: 'default', + params: {}, + frequency: { + notifyWhen: RuleNotifyWhen.ACTIVE, + throttle: null, + summary: false, + }, + }; + const wrapper = render( + + {getActionTypeForm({ + index: 1, + actionItem, + notifyWhenSelectOptions: CUSTOM_NOTIFY_WHEN_OPTIONS, + defaultNotifyWhenValue: RuleNotifyWhen.ACTIVE, + })} + + ); + + wrapper.getByTestId('notifyWhenSelect').click(); + await act(async () => { + expect(wrapper.queryByText('On status changes')).not.toBeTruthy(); + expect(wrapper.queryByText('On check intervals')).not.toBeTruthy(); + expect(wrapper.queryByText('On custom action intervals')).not.toBeTruthy(); + + expect(wrapper.getAllByText('Per rule run')).toBeTruthy(); + expect(wrapper.queryByText('Custom frequency')).not.toBeTruthy(); + + expect(wrapper.queryByTestId('onActionGroupChange')).not.toBeTruthy(); + expect(wrapper.getByTestId('onActiveAlert')).toBeTruthy(); + expect(wrapper.queryByTestId('onThrottleInterval')).not.toBeTruthy(); + }); + }); + }); }); function getActionTypeForm({ @@ -383,6 +517,8 @@ function getActionTypeForm({ setActionAlertsFilterProperty, hasSummary = true, messageVariables = { context: [], state: [], params: [] }, + notifyWhenSelectOptions, + defaultNotifyWhenValue, }: { index?: number; actionConnector?: ActionConnector, Record>; @@ -397,6 +533,8 @@ function getActionTypeForm({ setActionAlertsFilterProperty?: () => void; hasSummary?: boolean; messageVariables?: ActionVariables; + notifyWhenSelectOptions?: NotifyWhenSelectOptions[]; + defaultNotifyWhenValue?: RuleNotifyWhenType; }) { const actionConnectorDefault = { actionTypeId: '.pagerduty', @@ -481,6 +619,8 @@ function getActionTypeForm({ actionTypeRegistry={actionTypeRegistry} hasSummary={hasSummary} messageVariables={messageVariables} + notifyWhenSelectOptions={notifyWhenSelectOptions} + defaultNotifyWhenValue={defaultNotifyWhenValue} /> ); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx index c7a2f10ebc466c7..38d267d01482406 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx @@ -34,6 +34,7 @@ import { ActionVariable, RuleActionAlertsFilterProperty, RuleActionParam, + RuleNotifyWhenType, } from '@kbn/alerting-plugin/common'; import { getDurationNumberInItsUnit, @@ -49,6 +50,7 @@ import { ActionVariables, ActionTypeRegistryContract, ActionConnectorMode, + NotifyWhenSelectOptions, } from '../../../types'; import { checkActionFormActionTypeEnabled } from '../../lib/check_action_type_enabled'; import { hasSaveActionsCapability } from '../../lib/capabilities'; @@ -82,6 +84,8 @@ export type ActionTypeFormProps = { hideNotifyWhen?: boolean; hasSummary?: boolean; minimumThrottleInterval?: [number | undefined, string]; + notifyWhenSelectOptions?: NotifyWhenSelectOptions[]; + defaultNotifyWhenValue?: RuleNotifyWhenType; showActionAlertsFilter?: boolean; } & Pick< ActionAccordionFormProps, @@ -125,6 +129,8 @@ export const ActionTypeForm = ({ defaultSummaryMessage, hasSummary, minimumThrottleInterval, + notifyWhenSelectOptions, + defaultNotifyWhenValue, showActionAlertsFilter, }: ActionTypeFormProps) => { const { @@ -294,6 +300,8 @@ export const ActionTypeForm = ({ )} showMinimumThrottleWarning={showMinimumThrottleWarning} showMinimumThrottleUnitWarning={showMinimumThrottleUnitWarning} + notifyWhenSelectOptions={notifyWhenSelectOptions} + defaultNotifyWhenValue={defaultNotifyWhenValue} /> ); diff --git a/x-pack/plugins/triggers_actions_ui/public/index.ts b/x-pack/plugins/triggers_actions_ui/public/index.ts index d3cf89286ad9642..8fa34efd2e644c1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/index.ts @@ -42,6 +42,7 @@ export type { RuleDefinitionProps, RulesListVisibleColumns, AlertSummaryTimeRange, + NotifyWhenSelectOptions, } from './types'; export type { diff --git a/x-pack/plugins/triggers_actions_ui/public/types.ts b/x-pack/plugins/triggers_actions_ui/public/types.ts index 83e00bc6dd7c330..f2ecc1d1ec32d7c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/types.ts +++ b/x-pack/plugins/triggers_actions_ui/public/types.ts @@ -23,6 +23,7 @@ import type { EuiDataGridRefProps, EuiDataGridColumnCellAction, EuiDataGridToolBarVisibilityOptions, + EuiSuperSelectOption, } from '@elastic/eui'; import { EuiDataGridColumn, EuiDataGridControlColumn, EuiDataGridSorting } from '@elastic/eui'; import { HttpSetup } from '@kbn/core/public'; @@ -737,3 +738,9 @@ export interface TableUpdateHandlerArgs { export interface LazyLoadProps { hideLazyLoader?: boolean; } + +export interface NotifyWhenSelectOptions { + isSummaryOption?: boolean; + isForEachAlertOption?: boolean; + value: EuiSuperSelectOption; +}